/**
  * Returns a new ChildEventQuery object.
  *
  * @param     string $modelAlias The alias of a model in the query
  * @param     Criteria $criteria Optional Criteria to build the query from
  *
  * @return ChildEventQuery
  */
 public static function create($modelAlias = null, Criteria $criteria = null)
 {
     if ($criteria instanceof ChildEventQuery) {
         return $criteria;
     }
     $query = new ChildEventQuery();
     if (null !== $modelAlias) {
         $query->setModelAlias($modelAlias);
     }
     if ($criteria instanceof Criteria) {
         $query->mergeWith($criteria);
     }
     return $query;
 }
 /**
  * Returns the number of related Event objects.
  *
  * @param      Criteria $criteria
  * @param      boolean $distinct
  * @param      ConnectionInterface $con
  * @return int             Count of related Event objects.
  * @throws PropelException
  */
 public function countEvents(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
 {
     $partial = $this->collEventsPartial && !$this->isNew();
     if (null === $this->collEvents || null !== $criteria || $partial) {
         if ($this->isNew() && null === $this->collEvents) {
             return 0;
         }
         if ($partial && !$criteria) {
             return count($this->getEvents());
         }
         $query = ChildEventQuery::create(null, $criteria);
         if ($distinct) {
             $query->distinct();
         }
         return $query->filterByCreator($this)->count($con);
     }
     return count($this->collEvents);
 }
 /**
  * Get the associated ChildEvent object
  *
  * @param  ConnectionInterface $con Optional Connection object.
  * @return ChildEvent The associated ChildEvent object.
  * @throws PropelException
  */
 public function getTarget_Event(ConnectionInterface $con = null)
 {
     if ($this->aTarget_Event === null && $this->target_event_id !== null) {
         $this->aTarget_Event = ChildEventQuery::create()->findPk($this->target_event_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->aTarget_Event->addInterests($this);
            */
     }
     return $this->aTarget_Event;
 }
 /**
  * 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 = ChildEventQuery::create();
     $criteria->add(EventTableMap::COL_EVENT_ID, $this->event_id);
     return $criteria;
 }