diff --git a/lib/Cake/Model/Datasource/Database/Mysql.php b/lib/Cake/Model/Datasource/Database/Mysql.php index 7a13c3108..e2b164492 100644 --- a/lib/Cake/Model/Datasource/Database/Mysql.php +++ b/lib/Cake/Model/Datasource/Database/Mysql.php @@ -305,7 +305,7 @@ class Mysql extends DboSource { * Query charset by collation * * @param string $name Collation name - * @return string Character set name + * @return string|false Character set name */ public function getCharsetName($name) { if ((bool)version_compare($this->getVersion(), "5", "<")) { @@ -391,7 +391,7 @@ class Mysql extends DboSource { * @param array $fields The fields to update. * @param array $values The values to set. * @param mixed $conditions The conditions to use. - * @return array + * @return bool */ public function update(Model $model, $fields = array(), $values = null, $conditions = null) { if (!$this->_useAlias) { @@ -545,7 +545,7 @@ class Mysql extends DboSource { * * @param array $compare Result of a CakeSchema::compare() * @param string $table The table name. - * @return array Array of alter statements to make. + * @return string|false String of alter statements to make. */ public function alterSchema($compare, $table = null) { if (!is_array($compare)) { diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 876284f30..3c0f366f0 100644 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -247,6 +247,13 @@ class DboSource extends DataSource { */ protected $_methodCacheChange = false; +/** + * Map of the columns contained in a result. + * + * @var array + */ + public $map = array(); + /** * Constructor * diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index cd5300378..44df5c8e7 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -58,7 +58,7 @@ class Model extends CakeObject implements CakeEventListener { /** * Custom database table name, or null/false if no table association is desired. * - * @var string + * @var string|false * @link https://book.cakephp.org/2.0/en/models/model-attributes.html#usetable */ public $useTable = null; @@ -68,7 +68,7 @@ class Model extends CakeObject implements CakeEventListener { * * This field is also used in `find('list')` when called with no extra parameters in the fields list * - * @var string + * @var string|false * @link https://book.cakephp.org/2.0/en/models/model-attributes.html#displayfield */ public $displayField = null; @@ -84,7 +84,7 @@ class Model extends CakeObject implements CakeEventListener { /** * Container for the data that this model gets from persistent storage (usually, a database). * - * @var array + * @var array|false * @link https://book.cakephp.org/2.0/en/models/model-attributes.html#data */ public $data = array(); @@ -632,7 +632,7 @@ class Model extends CakeObject implements CakeEventListener { /** * The ID of the model record that was last inserted. * - * @var int + * @var int|string */ protected $_insertID = null; @@ -699,7 +699,7 @@ class Model extends CakeObject implements CakeEventListener { * * @param bool|int|string|array $id Set this ID for this model on startup, * can also be an array of options, see above. - * @param string $table Name of database table to use. + * @param string|false $table Name of database table to use. * @param string $ds DataSource connection name. */ public function __construct($id = false, $table = null, $ds = null) { @@ -1196,7 +1196,7 @@ class Model extends CakeObject implements CakeEventListener { * a one-item, two-dimensional array using $one for a key and $two as its value.) * * @param string|array|SimpleXmlElement|DomNode $one Array or string of data - * @param string $two Value string for the alternative indata method + * @param string|false $two Value string for the alternative indata method * @return array|null Data with all of $one's keys and values, otherwise null. * @link https://book.cakephp.org/2.0/en/models/saving-your-data.html */ @@ -1614,7 +1614,7 @@ class Model extends CakeObject implements CakeEventListener { * * @param string|array $fields String of single field name, or an array of field names. * @param int|string $id The ID of the record to read - * @return array Array of database fields, or false if not found + * @return array|false Array of database fields, or false if not found * @link https://book.cakephp.org/2.0/en/models/retrieving-your-data.html#model-read */ public function read($fields = null, $id = null) { @@ -3151,7 +3151,7 @@ class Model extends CakeObject implements CakeEventListener { * @param string $state Either "before" or "after" * @param array $query Query. * @param array $results Results. - * @return int The number of records found, or false + * @return int|false The number of records found, or false * @see Model::find() */ protected function _findCount($state, $query, $results = array()) { @@ -3495,7 +3495,7 @@ class Model extends CakeObject implements CakeEventListener { * Additionally it populates the validationErrors property of the model with the same array. * * @param array|string $options An optional array of custom options to be made available in the beforeValidate callback - * @return array Array of invalid fields and their error messages + * @return array|bool Array of invalid fields and their error messages * @see Model::validates() */ public function invalidFields($options = array()) { diff --git a/lib/Cake/Model/ModelValidator.php b/lib/Cake/Model/ModelValidator.php index c84e58f75..9ab4f3f2a 100644 --- a/lib/Cake/Model/ModelValidator.php +++ b/lib/Cake/Model/ModelValidator.php @@ -280,7 +280,7 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable { * why the rule failed * * @param string $field The name of the field to invalidate - * @param string $message Validation message explaining why the rule failed, defaults to true. + * @param string|bool $message Validation message explaining why the rule failed, defaults to true. * @return void */ public function invalidate($field, $message = true) {