/** * Returns a new EntryQuery object. * * @param string $entityType * @param string $modelAlias The alias of a model in the query * @param EntryQuery|Criteria $criteria Optional Criteria to build the query from * * @return EntryQuery */ public static function create($entityType = null, $modelAlias = null, $criteria = null) { if ($criteria instanceof EntryQuery) { if ($entityType) { $criteria->setEntityType($entityType); } // added this return $criteria; } $query = new EntryQuery(null, null, $modelAlias); if ($entityType) { $query->setEntityType($entityType); } // and this if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
/** * @param string $entityType * @param string $path * @return bool */ public static function doesPathExist($entityType, $path) { $path = static::_normalize($path); $pathKey = self::_pathKey($entityType, $path); if (\Propel::isInstancePoolingEnabled() && ($obj = static::getInstanceFromPool($pathKey))) { return true; } $count = EntryQuery::create($entityType)->filterByPath($path)->count(); return $count > 0; }
/** * @param EntityInterface $entity * @return \PropelCollection|Entry[] */ public function findAll($entity) { return EntryQuery::create()->filterByEntityType($entity->getTreeType())->filterByEntityId($entity->getTreeId())->find(); }
/** * @param string $path * @return int */ public function countDescendants($path) { return EntryQuery::create($this->entityType)->descendantsOf($path)->count(); }
/** * @return EntryQuery */ protected function createQuery() { return EntryQuery::create('AxisDocument'); }