diff --git a/lib/Cake/Model/AclNode.php b/lib/Cake/Model/AclNode.php index 63c29f04d6e..3e17217993c 100644 --- a/lib/Cake/Model/AclNode.php +++ b/lib/Cake/Model/AclNode.php @@ -89,8 +89,8 @@ public function node($ref = null) { )), 'order' => $db->name("{$type}.lft") . ' DESC' ); - - $conditionsAfterJoin = array(); + + $conditionsAfterJoin = array(); foreach ($path as $i => $alias) { $j = $i - 1; @@ -103,20 +103,18 @@ public function node($ref = null) { $db->name("{$type}{$i}.alias") . ' = ' . $db->value($alias, 'string') ) ); - - // it will be better if this conditions will performs after join operation - $conditionsAfterJoin[] = $db->name("{$type}{$j}.id") . ' = ' . $db->name("{$type}{$i}.parent_id"); - $conditionsAfterJoin[] = $db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght"); - $conditionsAfterJoin[] = $db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft"); + + // it will be better if this conditions will performs after join operation + $conditionsAfterJoin[] = $db->name("{$type}{$j}.id") . ' = ' . $db->name("{$type}{$i}.parent_id"); + $conditionsAfterJoin[] = $db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght"); + $conditionsAfterJoin[] = $db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft"); $queryData['conditions'] = array('or' => array( $db->name("{$type}.lft") . ' <= ' . $db->name("{$type}0.lft") . ' AND ' . $db->name("{$type}.rght") . ' >= ' . $db->name("{$type}0.rght"), $db->name("{$type}.lft") . ' <= ' . $db->name("{$type}{$i}.lft") . ' AND ' . $db->name("{$type}.rght") . ' >= ' . $db->name("{$type}{$i}.rght")) ); } - - $queryData['conditions'] = array_merge($queryData['conditions'], $conditionsAfterJoin); - + $queryData['conditions'] = array_merge($queryData['conditions'], $conditionsAfterJoin); $result = $db->read($this, $queryData, -1); $path = array_values($path); diff --git a/lib/Cake/Model/Datasource/DataSource.php b/lib/Cake/Model/Datasource/DataSource.php index e06ef86d64c..f76b01a5f12 100644 --- a/lib/Cake/Model/Datasource/DataSource.php +++ b/lib/Cake/Model/Datasource/DataSource.php @@ -89,7 +89,7 @@ public function __construct($config = array()) { /** * Caches/returns cached results for child instances * - * @param mixed $data + * @param mixed $data Unused in this class. * @return array Array of sources available in this datasource. */ public function listSources($data = null) { @@ -116,7 +116,7 @@ public function listSources($data = null) { /** * Returns a Model description (metadata) or null if none found. * - * @param Model|string $model + * @param Model|string $model The model to describe. * @return array Array of Metadata for the $model */ public function describe($model) { @@ -214,7 +214,7 @@ public function read(Model $Model, $queryData = array(), $recursive = null) { * @param Model $Model Instance of the model class being updated * @param array $fields Array of fields to be updated * @param array $values Array of values to be update $fields to. - * @param mixed $conditions + * @param mixed $conditions The array of conditions to use. * @return boolean Success */ public function update(Model $Model, $fields = null, $values = null, $conditions = null) { @@ -237,7 +237,7 @@ public function delete(Model $Model, $conditions = null) { /** * Returns the ID generated from the previous INSERT operation. * - * @param mixed $source + * @param mixed $source The source name. * @return mixed Last ID key generated in previous INSERT */ public function lastInsertId($source = null) { @@ -247,7 +247,7 @@ public function lastInsertId($source = null) { /** * Returns the number of rows returned by last operation. * - * @param mixed $source + * @param mixed $source The source name. * @return integer Number of rows returned by last operation */ public function lastNumRows($source = null) { @@ -257,7 +257,7 @@ public function lastNumRows($source = null) { /** * Returns the number of rows affected by last query. * - * @param mixed $source + * @param mixed $source The source name. * @return integer Number of rows affected by last query. */ public function lastAffected($source = null) { @@ -320,7 +320,7 @@ protected function _cacheDescription($object, $data = null) { * @param array $data Array of data with values that will be inserted in placeholders. * @param string $association Name of association model being replaced. * @param Model $Model Model instance. - * @param array $stack + * @param array $stack The context stack. * @return mixed String of query data with placeholders replaced, or false on failure. */ public function insertQueryData($query, $data, $association, Model $Model, $stack) { diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index 5f58fed5d6d..225057a63f3 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/lib/Cake/Model/Datasource/Database/Sqlite.php @@ -135,7 +135,7 @@ public function enabled() { /** * Returns an array of tables in the database. If there are no tables, an error is raised and the application exits. * - * @param mixed $data + * @param mixed $data Unused. * @return array Array of table names in the database */ public function listSources($data = null) { @@ -202,10 +202,10 @@ public function describe($model) { /** * Generates and executes an SQL UPDATE statement for given model, fields, and values. * - * @param Model $model - * @param array $fields - * @param array $values - * @param mixed $conditions + * @param Model $model The model instance to update. + * @param array $fields The fields to update. + * @param array $values The values to set columns to. + * @param mixed $conditions array of conditions to use. * @return array */ public function update(Model $model, $fields = array(), $values = null, $conditions = null) { @@ -448,9 +448,9 @@ public function getEncoding() { /** * Removes redundant primary key indexes, as they are handled in the column def of the key. * - * @param array $indexes - * @param string $table - * @return string + * @param array $indexes The indexes to build. + * @param string $table The table name. + * @return string The completed index. */ public function buildIndex($indexes, $table = null) { $join = array(); @@ -526,8 +526,8 @@ public function index($model) { /** * Overrides DboSource::renderStatement to handle schema generation with SQLite-style indexes * - * @param string $type - * @param array $data + * @param string $type The type of statement being rendered. + * @param array $data The data to convert to SQL. * @return string */ public function renderStatement($type, $data) { diff --git a/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php b/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php index 12b70b5dd2e..2e63b761e4d 100644 --- a/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeBaseReporter.php @@ -141,9 +141,9 @@ public function paintResult(PHPUnit_Framework_TestResult $result) { /** * An error occurred. * - * @param PHPUnit_Framework_Test $test The test to add an error for. - * @param Exception $e The exception object to add. - * @param float $time The current time. + * @param PHPUnit_Framework_Test $test The test to add an error for. + * @param Exception $e The exception object to add. + * @param float $time The current time. * @return void */ public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) { @@ -153,9 +153,9 @@ public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) { /** * A failure occurred. * - * @param PHPUnit_Framework_Test $test The test that failed - * @param PHPUnit_Framework_AssertionFailedError $e The assertion that failed. - * @param float $time The current time. + * @param PHPUnit_Framework_Test $test The test that failed + * @param PHPUnit_Framework_AssertionFailedError $e The assertion that failed. + * @param float $time The current time. * @return void */ public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) { @@ -165,9 +165,9 @@ public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_Asser /** * Incomplete test. * - * @param PHPUnit_Framework_Test $test The test that was incomplete. - * @param Exception $e The incomplete exception - * @param float $time The current time. + * @param PHPUnit_Framework_Test $test The test that was incomplete. + * @param Exception $e The incomplete exception + * @param float $time The current time. * @return void */ public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) { @@ -177,9 +177,9 @@ public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $t /** * Skipped test. * - * @param PHPUnit_Framework_Test $test The test that failed. - * @param Exception $e The skip object. - * @param float $time The current time. + * @param PHPUnit_Framework_Test $test The test that failed. + * @param Exception $e The skip object. + * @param float $time The current time. * @return void */ public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) { @@ -189,7 +189,7 @@ public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time /** * A test suite started. * - * @param PHPUnit_Framework_TestSuite $suite The suite to start + * @param PHPUnit_Framework_TestSuite $suite The suite to start * @return void */ public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { @@ -202,7 +202,7 @@ public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { /** * A test suite ended. * - * @param PHPUnit_Framework_TestSuite $suite The suite that ended. + * @param PHPUnit_Framework_TestSuite $suite The suite that ended. * @return void */ public function endTestSuite(PHPUnit_Framework_TestSuite $suite) { @@ -211,7 +211,7 @@ public function endTestSuite(PHPUnit_Framework_TestSuite $suite) { /** * A test started. * - * @param PHPUnit_Framework_Test $test The test that started. + * @param PHPUnit_Framework_Test $test The test that started. * @return void */ public function startTest(PHPUnit_Framework_Test $test) { @@ -220,8 +220,8 @@ public function startTest(PHPUnit_Framework_Test $test) { /** * A test ended. * - * @param PHPUnit_Framework_Test $test The test that ended - * @param float $time The current time. + * @param PHPUnit_Framework_Test $test The test that ended + * @param float $time The current time. * @return void */ public function endTest(PHPUnit_Framework_Test $test, $time) {