Pimcore\Model\Tool\Targeting\Persona::getById PHP Method

getById() public static method

public static getById ( $id ) : null | Persona
$id
return null | Persona
    public static function getById($id)
    {
        try {
            $persona = new self();
            $persona->setId(intval($id));
            $persona->getDao()->getById();
            return $persona;
        } catch (\Exception $e) {
            return null;
        }
    }

Usage Example

Example #1
0
 /**
  * @param $id
  * @return bool
  */
 public static function isIdActive($id)
 {
     $persona = Model\Tool\Targeting\Persona::getById($id);
     if ($persona) {
         return $persona->getActive();
     }
     return false;
 }
All Usage Examples Of Pimcore\Model\Tool\Targeting\Persona::getById