1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace KIF\Core;
- use KIF\Dao\DBAgileDev;
- abstract class Model {
-
- protected $objMainDao;
-
-
- abstract protected function setMainDao();
- public function __construct() {
- $this->setMainDao();
- }
-
- public function totals($condtion = null) {
- return $this->objMainDao->totals($condtion);
- }
- public function get($id) {
- $result = $this->gets(array($id));
- if (!$result) {
- return false;
- }
- return array_pop($result);
- }
- public function gets(array $ids) {
- $result = $this->objMainDao->gets($ids);
- return $result;
- }
-
- public function getsAll($order = null, $limit = null) {
- $ids = $this->objMainDao->getsAllIds($order, $limit);
- return $this->gets($ids);
- }
- }
|