public function factory($arrayfetch) { $arraytoret = array(); if ($arrayfetch) { foreach ($arrayfetch as $fetch) { $newObject = new Notificacion($this->driver); $newObject->fill($fetch); array_push($arraytoret, $newObject); } } return $arraytoret; }