MetaTemplate::getByTemplateIdOrName PHP Method

getByTemplateIdOrName() protected method

Try to get it from the template id (templates table)
Author: Mihai Balaceanu
protected getByTemplateIdOrName ( integer $tplId )
$tplId integer
    protected function getByTemplateIdOrName($tplId)
    {
        $doctrine = Zend_Registry::get('container')->getService('doctrine');
        if (is_numeric($tplId)) {
            $tpl = $doctrine->getEntityManager()->getRepository('Newscoop\\Entity\\Template')->find($tplId);
        } else {
            $tpl = $doctrine->getEntityManager()->getRepository('Newscoop\\Entity\\Template')->findOneBy(array('key' => $tplId));
        }
        /* @var $tpl \Newscoop\Entity\Template */
        $this->m_dbObject = $tpl;
    }