30 function add($object, $parent) {
31 if (is_a($object,
'Issue')) {
34 if (is_a($object,
'Submission')) {
36 $this->
_insertInternally($object,
'articlesByIssue', $object->getcurrentPublication()->getData(
'issueId'), $object->getId());
38 if (is_a($object,
'ArticleGalley')) {
39 assert(is_a($parent,
'Submission'));
41 $this->
_insertInternally($object,
'galleysByArticle', $object->getSubmissionId(), $object->getId());
42 $this->
_insertInternally($object,
'galleysByIssue', $parent->getIssueId(), $object->getId());
55 assert(is_array($this->_objectCache[$cacheId][$objectId]));
56 $this->_objectCache[$cacheId][$objectId][
'complete'] =
true;
59 ksort($this->_objectCache[$cacheId][$objectId]);
74 function get($cacheId, $id1, $id2 =
null) {
75 assert($this->
isCached($cacheId, $id1, $id2));
77 $returner = $this->_objectCache[$cacheId][$id1];
78 if (is_array($returner)) unset($returner[
'complete']);
81 return $this->_objectCache[$cacheId][$id1][$id2];
94 function isCached($cacheId, $id1, $id2 =
null) {
95 if (!isset($this->_objectCache[$cacheId]))
return false;
99 if (!isset($this->_objectCache[$cacheId][$id1]))
return false;
100 if (is_array($this->_objectCache[$cacheId][$id1])) {
101 return isset($this->_objectCache[$cacheId][$id1][
'complete']);
107 return isset($this->_objectCache[$cacheId][$id1][$id2]);
124 if ($this->
isCached($cacheId, $id1, $id2))
return;
126 if (!isset($this->_objectCache[$cacheId])) {
127 $this->_objectCache[$cacheId] = array();
132 $this->_objectCache[$cacheId][$id1] = $object;
135 if (!isset($this->_objectCache[$cacheId][$id1])) {
136 $this->_objectCache[$cacheId][$id1] = array();
138 $this->_objectCache[$cacheId][$id1][$id2] = $object;