private function matricule($object) { $temp = explode("\\", get_class($object)); $classe = $temp[count($temp) - 1]; $index = count($this->em->getRepository('TRCCoreBundle:' . $classe)->findAll()) + 1; $date = date('dmY'); $matricule = $this->ct($classe) . Core::position($index) . $date; return $matricule; }
public function rcDDC($ddc) { $ctc = $ddc->getTdc()->getCode(); $radical = $ddc->getClient()->getRadical(); //$temp = explode("\\", get_class($)); //$classe = $temp[count($temp) - 1]; $index = count($this->em->getRepository('TRCCoreBundle:DDC\\DDC')->findBy(array("client" => $ddc->getClient(), "tdc" => $ddc->getTdc()), array(), null, 0)) + 1; $date = date('dmY'); $matricule = $radical . $ctc . Core::position($index) . $date; return $matricule; }