public function getCollection(IEntity $owner, $child_class, QueryObject $query, $type) { $owner_key = spl_object_hash($owner); $query_key = md5(sprintf("%s_%s_%s", $query->__toString(), implode(',', $query->getAlias()), implode(',', $query->getOrder()))); $collection_key = md5(sprintf('%s_%s_%s', $owner_key, $child_class, $query_key)); $collections = array(); if ($type == '1-to-many') { if (array_key_exists($owner_key, $this->loaded_collections_one_2_many_identity_map)) { $collections = $this->loaded_collections_one_2_many_identity_map[$owner_key]; } } else { if (array_key_exists($owner_key, $this->loaded_collections_many_2_many_identity_map)) { $collections = $this->loaded_collections_many_2_many_identity_map[$owner_key]; } } if (array_key_exists($collection_key, $collections)) { return $collections[$collection_key]; } return false; }