Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
upgrade orm
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Apr 11, 2017
1 parent c699f49 commit e498baa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"require": {
"deimos/orm": "~2.0"
"deimos/orm": "~3.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0"
Expand Down
9 changes: 5 additions & 4 deletions demo/orm.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

include_once dirname(__DIR__) . '/vendor/autoload.php';

$builder = new \Deimos\Builder\Builder();
$helper = new \Deimos\Helper\Helper();

$db = new \Deimos\Database\Database(new \Deimos\Config\ConfigObject($builder, [
$db = new \Deimos\Database\Database(new \Deimos\Slice\Slice($helper, [
'adapter' => 'mysql',
'database' => 'test',
'username' => 'root',
'password' => 'root'
]));
$orm = new \Deimos\ORM\ORM($builder, $db);

$orm = new \Deimos\ORM\ORM($helper, $db);

$userQuery = $orm->repository('user');

Expand All @@ -22,4 +23,4 @@
var_dump($simple->currentPage());
var_dump($simple->itemCount());

var_dump($simple->currentItems(false));
var_dump($simple->currentItems(false));
2 changes: 1 addition & 1 deletion demo/simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
var_dump($simple->currentPage());
var_dump($simple->itemCount());

var_dump($simple->currentItems());
var_dump($simple->currentItems());
8 changes: 4 additions & 4 deletions src/Paginate/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract class Pager
/**
* @var int
*/
protected $defaultTake = 50;
protected $defaultLimit = 50;

/**
* @var array
Expand Down Expand Up @@ -43,8 +43,8 @@ protected function reset()
$this->loaded = false;
$this->storage = null;
$this->itemCount = null;
$this->limit = $this->defaultTake;
$this->page = 1;
$this->limit = $this->defaultLimit;
$this->page = 1;
}

/**
Expand Down Expand Up @@ -131,4 +131,4 @@ protected function offset()
return ($this->page - 1) * $this->limit;
}

}
}
2 changes: 1 addition & 1 deletion src/Paginate/Paginate.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ public function itemCount()
return $this->itemCount;
}

}
}

0 comments on commit e498baa

Please sign in to comment.