public function getChildren() { if ($this->isNew()) { return array(); } $c = new Criteria(); $c->add(AnnotationPeer::PARENT_ID, $this->getId()); $c->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_READY); return AnnotationPeer::doSelect($c); }
/** * @param int $entryId */ protected function entryDeleted($entryId) { $c = new Criteria(); $c->add(AnnotationPeer::ENTRY_ID, $entryId); $c->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED, Criteria::NOT_EQUAL); AnnotationPeer::setUseCriteriaFilter(false); $annotations = AnnotationPeer::doSelect($c); foreach ($annotations as $annotation) { kEventsManager::raiseEvent(new kObjectDeletedEvent($annotation)); } $update = new Criteria(); $update->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_DELETED); $con = Propel::getConnection(AnnotationPeer::DATABASE_NAME, Propel::CONNECTION_READ); BasePeer::doUpdate($c, $update, $con); }
/** * List annotation objects by filter and pager * * @action list * @param KalturaAnnotationFilter $filter * @param KalturaFilterPager $pager * @return KalturaAnnotationListResponse */ function listAction(KalturaAnnotationFilter $filter = null, KalturaFilterPager $pager = null) { kalturalog::debug("annotation service listAction"); if (!$filter) { $filter = new KalturaAnnotationFilter(); } $c = new Criteria(); $c->add(AnnotationPeer::STATUS, AnnotationStatus::ANNOTATION_STATUS_READY); $c->add(AnnotationPeer::TYPE, AnnotationType::ANNOTATION); $annotationFilter = new AnnotationFilter(); $filter->toObject($annotationFilter); $annotationFilter->attachToCriteria($c); $count = AnnotationPeer::doCount($c); if ($pager) { $pager->attachToCriteria($c); } $list = AnnotationPeer::doSelect($c); $response = new KalturaAnnotationListResponse(); $response->objects = KalturaAnnotationArray::fromDbArray($list); $response->totalCount = $count; return $response; }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(AnnotationPeer::DATABASE_NAME); $criteria->add(AnnotationPeer::ID, $pks, Criteria::IN); $objs = AnnotationPeer::doSelect($criteria, $con); } return $objs; }