Ejemplo n.º 1
0
 /**
  * Helper to load all idioms
  */
 public function loadIdioms()
 {
     $idioms = R::find('idiom');
     foreach ($idioms as $item) {
         $idiom = new Idiom();
         $idiom->importBean($item);
         $this->idioms[] = $idiom;
     }
 }
Ejemplo n.º 2
0
 /**
  * This will allow to import RedBean OODBBean objects
  * @param RedBean_OODBBean $bean
  */
 public function importBean($bean)
 {
     parent::importBean($bean);
     if ($bean->image) {
         $this->image = new Image($bean->image);
     }
     $idiom = $bean->idiom;
     $this->idiom = new Idiom();
     $this->idiom->importBean($idiom);
     // load author
     $result = R::findOne('account', 'username = ?', array($this->author));
     if (!empty($result)) {
         $author = new Account();
         $author->importBean($result);
         $this->author = $author;
     }
 }