Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removing deprecated model methods

  • Loading branch information...
commit 3c76f173f796a3a705d644a4925a99fa16f2d65d 1 parent bc35925
gwoo authored
View
49 cake/libs/model/model.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');
View
50 cake/tests/cases/libs/model/model.test.php
@@ -8218,56 +8218,6 @@ function testFindNeighbors() {
$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
*
* @access public
Please sign in to comment.
Something went wrong with that request. Please try again.