/**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Batch is new, it will return
  * an empty collection; or if this Batch has previously
  * been saved, it will retrieve related FileImportHistorys from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Batch.
  */
 public function getFileImportHistorysJoinSchema($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'lib/model/om/BaseFileImportHistoryPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collFileImportHistorys === null) {
         if ($this->isNew()) {
             $this->collFileImportHistorys = array();
         } else {
             $criteria->add(FileImportHistoryPeer::BATCH_ID, $this->getId());
             $this->collFileImportHistorys = FileImportHistoryPeer::doSelectJoinSchema($criteria, $con);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(FileImportHistoryPeer::BATCH_ID, $this->getId());
         if (!isset($this->lastFileImportHistoryCriteria) || !$this->lastFileImportHistoryCriteria->equals($criteria)) {
             $this->collFileImportHistorys = FileImportHistoryPeer::doSelectJoinSchema($criteria, $con);
         }
     }
     $this->lastFileImportHistoryCriteria = $criteria;
     return $this->collFileImportHistorys;
 }
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Room is new, it will return
  * an empty collection; or if this Room has previously
  * been saved, it will retrieve related Permissions from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Room.
  */
 public function getPermissionsJoinUser($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'src/model/whiteboard/om/BasePermissionPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPermissions === null) {
         if ($this->isNew()) {
             $this->collPermissions = array();
         } else {
             $criteria->add(PermissionPeer::ROOM_ID, $this->getRoomId());
             $this->collPermissions = PermissionPeer::doSelectJoinUser($criteria, $con);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(PermissionPeer::ROOM_ID, $this->getRoomId());
         if (!isset($this->lastPermissionCriteria) || !$this->lastPermissionCriteria->equals($criteria)) {
             $this->collPermissions = PermissionPeer::doSelectJoinUser($criteria, $con);
         }
     }
     $this->lastPermissionCriteria = $criteria;
     return $this->collPermissions;
 }
Example #3
0
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Blog has previously
  * been saved, it will retrieve related Posts from storage.
  * If this Blog is new, it will return
  * an empty collection or the current collection, the criteria
  * is ignored on a new object.
  *
  * @param      Connection $con
  * @param      Criteria $criteria
  * @throws     PropelException
  */
 public function getPosts($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'lib/model/om/BasePostPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collPosts === null) {
         if ($this->isNew()) {
             $this->collPosts = array();
         } else {
             $criteria->add(PostPeer::BLOG_ID, $this->getId());
             PostPeer::addSelectColumns($criteria);
             $this->collPosts = PostPeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(PostPeer::BLOG_ID, $this->getId());
             PostPeer::addSelectColumns($criteria);
             if (!isset($this->lastPostCriteria) || !$this->lastPostCriteria->equals($criteria)) {
                 $this->collPosts = PostPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastPostCriteria = $criteria;
     return $this->collPosts;
 }
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this BpmnDiagram is new, it will return
  * an empty collection; or if this BpmnDiagram has previously
  * been saved, it will retrieve related BpmnFlows from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in BpmnDiagram.
  */
 public function getBpmnFlowsJoinBpmnProject($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'classes/model/om/BaseBpmnFlowPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collBpmnFlows === null) {
         if ($this->isNew()) {
             $this->collBpmnFlows = array();
         } else {
             $criteria->add(BpmnFlowPeer::DIA_UID, $this->getDiaUid());
             $this->collBpmnFlows = BpmnFlowPeer::doSelectJoinBpmnProject($criteria, $con);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(BpmnFlowPeer::DIA_UID, $this->getDiaUid());
         if (!isset($this->lastBpmnFlowCriteria) || !$this->lastBpmnFlowCriteria->equals($criteria)) {
             $this->collBpmnFlows = BpmnFlowPeer::doSelectJoinBpmnProject($criteria, $con);
         }
     }
     $this->lastBpmnFlowCriteria = $criteria;
     return $this->collBpmnFlows;
 }
Example #5
0
<?php

$repository = new BlogPostRepository();
$criteria = new Criteria();
$criteria->equals('BlogPost.ID', $blog_post_id);
$criteria->limit($limit);
$related_blog_poasts = $repository->getTagRelated($criteria);
Example #6
0
 /**
  * Test whether GROUP BY is being respected in equals() check.
  * @link       http://propel.phpdb.org/trac/ticket/674
  */
 public function testEqualsGroupBy()
 {
     $c1 = new Criteria();
     $c1->addGroupByColumn('GBY1');
     $c2 = new Criteria();
     $c2->addGroupByColumn('GBY2');
     $this->assertFalse($c2->equals($c1), "Expected Criteria NOT to be the same with different GROUP BY columns");
     $c3 = new Criteria();
     $c3->addGroupByColumn('GBY1');
     $c4 = new Criteria();
     $c4->addGroupByColumn('GBY1');
     $this->assertTrue($c4->equals($c3), "Expected Criteria objects to match.");
 }
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this ConceptProperty is new, it will return
  * an empty collection; or if this ConceptProperty has previously
  * been saved, it will retrieve related Discusss from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in ConceptProperty.
  */
 public function getDiscusssJoinDiscussRelatedByParentId($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'lib/model/om/BaseDiscussPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collDiscusss === null) {
         if ($this->isNew()) {
             $this->collDiscusss = array();
         } else {
             $criteria->add(DiscussPeer::CONCEPT_PROPERTY_ID, $this->getId());
             $this->collDiscusss = DiscussPeer::doSelectJoinDiscussRelatedByParentId($criteria, $con);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(DiscussPeer::CONCEPT_PROPERTY_ID, $this->getId());
         if (!isset($this->lastDiscussCriteria) || !$this->lastDiscussCriteria->equals($criteria)) {
             $this->collDiscusss = DiscussPeer::doSelectJoinDiscussRelatedByParentId($criteria, $con);
         }
     }
     $this->lastDiscussCriteria = $criteria;
     return $this->collDiscusss;
 }
Example #8
0
 /**
  * @covers Gacela\Criteria::equals
  */
 public function testEquals()
 {
     $this->object->equals('test', 'test');
     $this->assertAttributeSame(array(array('equals', 'test', 'test')), '_criteria', $this->object);
 }
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this SchemaProperty is new, it will return
  * an empty collection; or if this SchemaProperty has previously
  * been saved, it will retrieve related SchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in SchemaProperty.
  */
 public function getSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyIdJoinFileImportHistory($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'lib/model/om/BaseSchemaPropertyElementHistoryPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId === null) {
         if ($this->isNew()) {
             $this->collSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId = array();
         } else {
             $criteria->add(SchemaPropertyElementHistoryPeer::RELATED_SCHEMA_PROPERTY_ID, $this->getId());
             $this->collSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId = SchemaPropertyElementHistoryPeer::doSelectJoinFileImportHistory($criteria, $con);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(SchemaPropertyElementHistoryPeer::RELATED_SCHEMA_PROPERTY_ID, $this->getId());
         if (!isset($this->lastSchemaPropertyElementHistoryRelatedByRelatedSchemaPropertyIdCriteria) || !$this->lastSchemaPropertyElementHistoryRelatedByRelatedSchemaPropertyIdCriteria->equals($criteria)) {
             $this->collSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId = SchemaPropertyElementHistoryPeer::doSelectJoinFileImportHistory($criteria, $con);
         }
     }
     $this->lastSchemaPropertyElementHistoryRelatedByRelatedSchemaPropertyIdCriteria = $criteria;
     return $this->collSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyId;
 }
 /**
  * If this collection has already been initialized with
  * an identical criteria, it returns the collection.
  * Otherwise if this Vocabulary is new, it will return
  * an empty collection; or if this Vocabulary has previously
  * been saved, it will retrieve related VocabularyHasVersions from storage.
  *
  * This method is protected by default in order to keep the public
  * api reasonable.  You can provide public methods for those you
  * actually need in Vocabulary.
  */
 public function getVocabularyHasVersionsJoinUser($criteria = null, $con = null)
 {
     // include the Peer class
     include_once 'lib/model/om/BaseVocabularyHasVersionPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collVocabularyHasVersions === null) {
         if ($this->isNew()) {
             $this->collVocabularyHasVersions = array();
         } else {
             $criteria->add(VocabularyHasVersionPeer::VOCABULARY_ID, $this->getId());
             $this->collVocabularyHasVersions = VocabularyHasVersionPeer::doSelectJoinUser($criteria, $con);
         }
     } else {
         // the following code is to determine if a new query is
         // called for.  If the criteria is the same as the last
         // one, just return the collection.
         $criteria->add(VocabularyHasVersionPeer::VOCABULARY_ID, $this->getId());
         if (!isset($this->lastVocabularyHasVersionCriteria) || !$this->lastVocabularyHasVersionCriteria->equals($criteria)) {
             $this->collVocabularyHasVersions = VocabularyHasVersionPeer::doSelectJoinUser($criteria, $con);
         }
     }
     $this->lastVocabularyHasVersionCriteria = $criteria;
     return $this->collVocabularyHasVersions;
 }