removing deprecated model methods

This commit is contained in:
gwoo 2009-07-02 10:24:42 -07:00
parent bc359259a2
commit 3c76f173f7
2 changed files with 0 additions and 99 deletions
cake
libs/model
tests/cases/libs/model

View file

@ -2865,55 +2865,6 @@ class Model extends Overloadable {
*/
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');

View file

@ -8217,56 +8217,6 @@ class ModelTest extends CakeTestCase {
$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
*