public function __construct($data) { parent::__construct($data); $id = $this->getId(); $type = $this->getType(); if (!$type) { $id > 0 && ($this->type = 'private'); $id < 0 && ($this->type = 'group'); } }