Skip to content
Permalink
Browse files

removing deprecated model methods

  • Loading branch information...
gwoo
gwoo committed Jul 2, 2009
1 parent bc35925 commit 3c76f173f796a3a705d644a4925a99fa16f2d65d
Showing with 0 additions and 99 deletions.
  1. +0 −49 cake/libs/model/model.php
  2. +0 −50 cake/tests/cases/libs/model/model.test.php
@@ -2865,55 +2865,6 @@ function __sleep() {
*/
function __wakeup() {
}
/**
* @deprecated
* @see Model::find('all')
*/
function findAll($conditions = null, $fields = null, $order = null, $limit = null, $page = 1, $recursive = null) {
trigger_error(
__('(Model::findAll) Deprecated, use Model::find("all")', true),
E_USER_WARNING
);
return $this->find('all', compact('conditions', 'fields', 'order', 'limit', 'page', 'recursive'));
}
/**
* @deprecated
* @see Model::find('count')
*/
function findCount($conditions = null, $recursive = 0) {
trigger_error(
__('(Model::findCount) Deprecated, use Model::find("count")', true),
E_USER_WARNING
);
return $this->find('count', compact('conditions', 'recursive'));
}
/**
* @deprecated
* @see Model::find('threaded')
*/
function findAllThreaded($conditions = null, $fields = null, $order = null) {
trigger_error(
__('(Model::findAllThreaded) Deprecated, use Model::find("threaded")', true),
E_USER_WARNING
);
return $this->find('threaded', compact('conditions', 'fields', 'order'));
}
/**
* @deprecated
* @see Model::find('neighbors')
*/
function findNeighbours($conditions = null, $field, $value) {
trigger_error(
__('(Model::findNeighbours) Deprecated, use Model::find("neighbors")', true),
E_USER_WARNING
);
$query = compact('conditions', 'field', 'value');
$query['fields'] = $field;
if (is_array($field)) {
$query['field'] = $field[0];
}
return $this->find('neighbors', $query);
}
}
if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
Overloadable::overload('Model');
@@ -8217,56 +8217,6 @@ function testFindNeighbors() {
$expected = array('prev' => $two, 'next' => null);
$this->assertEqual($result, $expected);
}
/**
* test findNeighbours() method
*
* @return void
* @access public
*/
function testFindNeighboursLegacy() {
$this->loadFixtures('User', 'Article');
$TestModel =& new Article();
$result = $TestModel->findNeighbours(null, 'Article.id', '2');
$expected = array(
'prev' => array(
'Article' => array(
'id' => 1
)),
'next' => array(
'Article' => array(
'id' => 3
)));
$this->assertEqual($result, $expected);
$result = $TestModel->findNeighbours(null, 'Article.id', '3');
$expected = array(
'prev' => array(
'Article' => array(
'id' => 2
)),
'next' => array()
);
$this->assertEqual($result, $expected);
$result = $TestModel->findNeighbours(
array('User.id' => 1),
array('Article.id', 'Article.title'),
2
);
$expected = array(
'prev' => array(
'Article' => array(
'id' => 1,
'title' => 'First Article'
)),
'next' => array(
'Article' => array(
'id' => 3,
'title' => 'Third Article'
)));
$this->assertEqual($result, $expected);
}
/**
* testFindCombinedRelations method
*

0 comments on commit 3c76f17

Please sign in to comment.
You can’t perform that action at this time.