public static function get() { $list = parent::get(); if ($res = self::query_remote("SELECT * FROM RestDataObject")) { foreach ($res as $item) { $list->push(new ExternalMySQLDataObject($item)); } } return $list; }
/** * Child classes should call $list = parent::get(); */ public static function get() { $list = parent::get(); $result = self::service()->request('/RestDataObject'); if ($result->getStatusCode() == 200) { $body = Convert::json2obj($result->getBody()); if (isset($body->items)) { foreach ($body->items as $item) { $list->push(new ExternalRestDataObject((array) $item)); } } } return $list; }
/** * Child classes should call $list = parent::get(); */ public static function get() { $list = parent::get(); $cursor = self::collection()->find(); if ($cursor) { foreach ($cursor as $key => $document) { //var_dump($document); if (is_object($document["_id"])) { $class = get_called_class(); $list->push(new $class($document)); } else { $collection->remove(array('_id' => $key)); } } } return $list; }