本文整理汇总了PHP中Criteria::equals方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::equals方法的具体用法?PHP Criteria::equals怎么用?PHP Criteria::equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Criteria
的用法示例。
在下文中一共展示了Criteria::equals方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFileImportHistorysJoinSchema
/**
* 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;
}
示例2: getPermissionsJoinUser
/**
* 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;
}
示例3: getPosts
/**
* 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;
}
示例4: getBpmnFlowsJoinBpmnProject
/**
* 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;
}
示例5: BlogPostRepository
<?php
$repository = new BlogPostRepository();
$criteria = new Criteria();
$criteria->equals('BlogPost.ID', $blog_post_id);
$criteria->limit($limit);
$related_blog_poasts = $repository->getTagRelated($criteria);
示例6: testEqualsGroupBy
/**
* 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.");
}
示例7: getDiscusssJoinDiscussRelatedByParentId
/**
* 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;
}
示例8: testEquals
/**
* @covers Gacela\Criteria::equals
*/
public function testEquals()
{
$this->object->equals('test', 'test');
$this->assertAttributeSame(array(array('equals', 'test', 'test')), '_criteria', $this->object);
}
示例9: getSchemaPropertyElementHistorysRelatedByRelatedSchemaPropertyIdJoinFileImportHistory
/**
* 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;
}
示例10: getVocabularyHasVersionsJoinUser
/**
* 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;
}