Ejemplo n.º 1
0
 /**
  * Returns a new ProcedimientoQuery object.
  *
  * @param     string $modelAlias The alias of a model in the query
  * @param     ProcedimientoQuery|Criteria $criteria Optional Criteria to build the query from
  *
  * @return ProcedimientoQuery
  */
 public static function create($modelAlias = null, $criteria = null)
 {
     if ($criteria instanceof ProcedimientoQuery) {
         return $criteria;
     }
     $query = new ProcedimientoQuery();
     if (null !== $modelAlias) {
         $query->setModelAlias($modelAlias);
     }
     if ($criteria instanceof Criteria) {
         $query->mergeWith($criteria);
     }
     return $query;
 }
Ejemplo n.º 2
0
 /**
  * Get the associated Procedimiento object
  *
  * @param PropelPDO $con Optional Connection object.
  * @return Procedimiento The associated Procedimiento object.
  * @throws PropelException
  */
 public function getProcedimiento(PropelPDO $con = null)
 {
     if ($this->aProcedimiento === null && $this->tipo_proc_id !== null) {
         $this->aProcedimiento = ProcedimientoQuery::create()->findPk($this->tipo_proc_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->aProcedimiento->addAgendas($this);
            */
     }
     return $this->aProcedimiento;
 }
Ejemplo n.º 3
0
 /**
  * Get the slug, ensuring its uniqueness
  *
  * @param	string $slug			the slug to check
  * @param	string $separator the separator used by slug
  * @param	int    $increment the count of occurences of the slug
  * @return string						the unique slug
  */
 protected function makeSlugUnique($slug, $separator = '-', $increment = 0)
 {
     $slug2 = empty($increment) ? $slug : $slug . $separator . $increment;
     $slugAlreadyExists = ProcedimientoQuery::create()->filterBySlug($slug2)->prune($this)->count();
     if ($slugAlreadyExists) {
         return $this->makeSlugUnique($slug, $separator, ++$increment);
     } else {
         return $slug2;
     }
 }