コード例 #1
0
ファイル: Rig.php プロジェクト: pcmasteratings/site
 /**
  * Builds a Criteria object containing the primary key for this object.
  *
  * Unlike buildCriteria() this method includes the primary key values regardless
  * of whether or not they have been modified.
  *
  * @throws LogicException if no primary key is defined
  *
  * @return Criteria The Criteria object containing value(s) for primary key(s).
  */
 public function buildPkeyCriteria()
 {
     $criteria = ChildRigQuery::create();
     $criteria->add(RigTableMap::COL_ID, $this->id);
     return $criteria;
 }
コード例 #2
0
 /**
  * Get the associated ChildRig object
  *
  * @param  ConnectionInterface $con Optional Connection object.
  * @return ChildRig The associated ChildRig object.
  * @throws PropelException
  */
 public function getRig(ConnectionInterface $con = null)
 {
     if ($this->aRig === null && ($this->rig_id !== "" && $this->rig_id !== null)) {
         $this->aRig = ChildRigQuery::create()->findPk($this->rig_id, $con);
         /* The following can be used additionally to
               guarantee the related object contains a reference
               to this object.  This level of coupling may, however, be
               undesirable since it could result in an only partially populated collection
               in the referenced object.
               $this->aRig->addRigAttributeValues($this);
            */
     }
     return $this->aRig;
 }
コード例 #3
0
ファイル: User.php プロジェクト: pcmasteratings/site
 /**
  * Returns the number of related Rig objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      ConnectionInterface $con
  * @return int             Count of related Rig objects.
  * @throws PropelException
  */
 public function countRigs(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
 {
     $partial = $this->collRigsPartial && !$this->isNew();
     if (null === $this->collRigs || null !== $criteria || $partial) {
         if ($this->isNew() && null === $this->collRigs) {
             return 0;
         }
         if ($partial && !$criteria) {
             return count($this->getRigs());
         }
         $query = ChildRigQuery::create(null, $criteria);
         if ($distinct) {
             $query->distinct();
         }
         return $query->filterByUser($this)->count($con);
     }
     return count($this->collRigs);
 }