/** * Gets the latest CExObject for the given CMbObject host object * * @param CMbObject $object The host object * * @return CExObject The resolved CExObject */ function getLatestExObject(CMbObject $object) { if (isset($this->_latest_ex_object_cache[$object->_class][$object->_id])) { return $this->_latest_ex_object_cache[$object->_class][$object->_id]; } $ex_link = new CExLink(); $where = array("object_class" => " = '{$object->_class}'", "object_id" => " = '{$object->_id}'", "ex_class_id" => " = '{$this->_id}'", "level" => $ex_link->getDS()->prepareIn(array("object", "ref1", "ref2"))); $ex_link->loadObject($where, "ex_object_id DESC"); $ex_object = $ex_link->loadRefExObject(); return $this->_latest_ex_object_cache[$object->_class][$object->_id] = $ex_object; }