/** * Метод - чтение из недоступного свойства * @param $name имя недоступного свойства * @return object | bool | null */ public function __get($name) { switch ($name) { case 'author': return Author::findById($this->author_id); break; default: return null; } }
public function testCollectionName() { $this->assertSame('authors', \Model\Author::getCollectionName()); }