private function update(IdentifiableOrmEntity $entity) { $affected = $this->executeQuery(UpdateQuery::create($this->physicalSchema->getTable())->setValues($this->map->disassemble($entity))->setCondition(EntityQuery::create($this->entity)->where(Expression::eq($this->identifier, $entity->_getId()))->toExpression())); $entity->setFetched(); return $affected > 0; }
function dropAll() { Assert::isFalse($this->isReadonly(), 'cannot drop readonly collections'); $query = EntityQuery::create($this->mtm->getProxy())->where(Expression::eq($this->mtm->getContainerProxyProperty(), $this->getParentObject())); $count = $query->delete(); $this->clean(); return $count; }
function action_newsList() { $announcements = EntityQuery::create(Announcement::orm())->orderBy(OrderBy::desc('date'))->setLimit(self::LIMIT_ENTRIES_PER_PAGE)->setOffset(0)->getList(); $this->getModel()->append(array('announcements' => $announcements, 'breadScrumbs' => array())); return 'news'; }