public function bindPublisher() { $bean = $this->_bean; if ($bean === null) { return $this; } $this->publisher = Publisher::fromBean($bean->publisher); return $this; }
public static function searchByName($name, $limit = 10) { $beans = R::findAll('publisher', ' name like :name order by name limit :limit ', ['limit' => $limit, 'name' => '%' . $name . '%']); $publishers = []; foreach ($beans as $bean) { $publishers[] = Publisher::fromBean($bean); } return $publishers; }