30 function add($object, $parent) {
31 if (is_a($object,
'Submission')) {
34 if (is_a($object,
'ArticleGalley')) {
35 assert(is_a($parent,
'Submission'));
37 $this->
_insertInternally($object,
'galleysByArticle', $object->getSubmissionId(), $object->getId());
50 assert(is_array($this->_objectCache[$cacheId][$objectId]));
51 $this->_objectCache[$cacheId][$objectId][
'complete'] =
true;
54 ksort($this->_objectCache[$cacheId][$objectId]);
69 function get($cacheId, $id1, $id2 =
null) {
70 assert($this->
isCached($cacheId, $id1, $id2));
72 $returner = $this->_objectCache[$cacheId][$id1];
73 if (is_array($returner)) unset($returner[
'complete']);
76 return $this->_objectCache[$cacheId][$id1][$id2];
89 function isCached($cacheId, $id1, $id2 =
null) {
90 if (!isset($this->_objectCache[$cacheId]))
return false;
94 if (!isset($this->_objectCache[$cacheId][$id1]))
return false;
95 if (is_array($this->_objectCache[$cacheId][$id1])) {
96 return isset($this->_objectCache[$cacheId][$id1][
'complete']);
102 return isset($this->_objectCache[$cacheId][$id1][$id2]);
119 if ($this->
isCached($cacheId, $id1, $id2))
return;
121 if (!isset($this->_objectCache[$cacheId])) {
122 $this->_objectCache[$cacheId] = array();
127 $this->_objectCache[$cacheId][$id1] = $object;
130 if (!isset($this->_objectCache[$cacheId][$id1])) {
131 $this->_objectCache[$cacheId][$id1] = array();
133 $this->_objectCache[$cacheId][$id1][$id2] = $object;