Ejemplo n.º 1
0
 /**
  * Returns a new ChildExpertsQuery object.
  *
  * @param     string $modelAlias The alias of a model in the query
  * @param     Criteria $criteria Optional Criteria to build the query from
  *
  * @return ChildExpertsQuery
  */
 public static function create($modelAlias = null, Criteria $criteria = null)
 {
     if ($criteria instanceof ChildExpertsQuery) {
         return $criteria;
     }
     $query = new ChildExpertsQuery();
     if (null !== $modelAlias) {
         $query->setModelAlias($modelAlias);
     }
     if ($criteria instanceof Criteria) {
         $query->mergeWith($criteria);
     }
     return $query;
 }
 /**
  * Get the associated ChildExperts object
  *
  * @param  ConnectionInterface $con Optional Connection object.
  * @return ChildExperts The associated ChildExperts object.
  * @throws PropelException
  */
 public function getExperts(ConnectionInterface $con = null)
 {
     if ($this->aExperts === null && ($this->expert !== "" && $this->expert !== null)) {
         $this->aExperts = ChildExpertsQuery::create()->findPk($this->expert, $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->aExperts->addExpertGroupMemberss($this);
            */
     }
     return $this->aExperts;
 }
Ejemplo n.º 3
0
 /**
  * Removes this object from datastore and sets delete attribute.
  *
  * @param      ConnectionInterface $con
  * @return void
  * @throws PropelException
  * @see Experts::setDeleted()
  * @see Experts::isDeleted()
  */
 public function delete(ConnectionInterface $con = null)
 {
     if ($this->isDeleted()) {
         throw new PropelException("This object has already been deleted.");
     }
     if ($con === null) {
         $con = Propel::getServiceContainer()->getWriteConnection(ExpertsTableMap::DATABASE_NAME);
     }
     $con->transaction(function () use($con) {
         $deleteQuery = ChildExpertsQuery::create()->filterByPrimaryKey($this->getPrimaryKey());
         $ret = $this->preDelete($con);
         if ($ret) {
             $deleteQuery->delete($con);
             $this->postDelete($con);
             $this->setDeleted(true);
         }
     });
 }