There is a class:
class VideoModel extends BaseModel { ... protected $youtubeId; protected function setYouTubeId($value) { if (!empty($value)) { $this->setUploadedAt(date('Ymd H:i:s')); $this->youtubeId = $value; return true; } return false; } } class BaseModel { ... public function __get($field) { // check if getter exists $getterName = 'get'.ucfirst($field); if (method_exists($this, $getterName)) { return $this->$getterName(); } if (isset($this->$field)) { return $this->$field; } return null; } } This code does not work as expected:
 >> var_dump($webinar->youtubeId); string 'rzCGzjbyQjc' (length=11) >> var_dump(empty($webinar->youtubeId)); boolean true 
(isset($this->$field))in the code I seeissetand where do you checkemptywhy? - Naumovif (!empty($webinar->youtubeId)) { include '_webinarPlayer.php'; } else { include '_waitForRecord.php'; }). - Makarenko_I_Vvar_dumpright beforeifwhat does it say? not in console xdebug - Naumov