/** * 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; }
/** * 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; } }