Example #1
0
 /**
  * @param Entity $entity
  * @return EntityManagerMysqli
  */
 protected function fetch(\mysqli_result $result, Entity $entity = null)
 {
     while ($data = $result->fetch_assoc()) {
         $this->add($entity->getClone()->serialize($data));
     }
     return $this;
 }
Example #2
0
 /**
  * @return array
  */
 public function toArray()
 {
     $arr = parent::toArray();
     $arr["data"] = array();
     foreach ($this as $Entity) {
         $arr["data"][] = $Entity->toArray();
     }
     return $arr;
 }