mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-14 18:53:36 +00:00
removing deprecated model methods
This commit is contained in:
parent
bc359259a2
commit
3c76f173f7
2 changed files with 0 additions and 99 deletions
cake
|
@ -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');
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue