Applying doc patch (ticket #1186)

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3275 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
dho 2006-07-21 08:48:41 +00:00
parent bd4dfb525f
commit 37e7d798d1
2 changed files with 80 additions and 32 deletions

View file

@ -83,7 +83,7 @@ class Model extends Object{
/** /**
* Value of the primary key ID of the record that this model is currently pointing to * Value of the primary key ID of the record that this model is currently pointing to
* *
* @var unknown_type * @var integer
* @access public * @access public
*/ */
var $id = false; var $id = false;
@ -125,12 +125,14 @@ class Model extends Object{
* that have to match with preg_match(). Use these rules with Model::validate() * that have to match with preg_match(). Use these rules with Model::validate()
* *
* @var array * @var array
* @access public
*/ */
var $validate = array(); var $validate = array();
/** /**
* Errors in validation * Errors in validation
* @var array * @var array
* @access public
*/ */
var $validationErrors = array(); var $validationErrors = array();
@ -138,6 +140,7 @@ class Model extends Object{
* Database table prefix for tables in model. * Database table prefix for tables in model.
* *
* @var string * @var string
* @access public
*/ */
var $tablePrefix = null; var $tablePrefix = null;
@ -159,6 +162,7 @@ class Model extends Object{
* List of table names included in the Model description. Used for associations. * List of table names included in the Model description. Used for associations.
* *
* @var array * @var array
* @access public
*/ */
var $tableToModel = array(); var $tableToModel = array();
@ -166,6 +170,7 @@ class Model extends Object{
* List of Model names by used tables. Used for associations. * List of Model names by used tables. Used for associations.
* *
* @var array * @var array
* @access public
*/ */
var $modelToTable = array(); var $modelToTable = array();
@ -173,6 +178,7 @@ class Model extends Object{
* List of Foreign Key names to used tables. Used for associations. * List of Foreign Key names to used tables. Used for associations.
* *
* @var array * @var array
* @access public
*/ */
var $keyToTable = array(); var $keyToTable = array();
@ -180,6 +186,7 @@ class Model extends Object{
* Alias table names for model, for use in SQL JOIN statements. * Alias table names for model, for use in SQL JOIN statements.
* *
* @var array * @var array
* @access public
*/ */
var $alias = array(); var $alias = array();
@ -187,6 +194,7 @@ class Model extends Object{
* Whether or not transactions for this model should be logged * Whether or not transactions for this model should be logged
* *
* @var boolean * @var boolean
* @access public
*/ */
var $logTransactions = false; var $logTransactions = false;
@ -194,6 +202,7 @@ class Model extends Object{
* Whether or not to enable transactions for this model (i.e. BEGIN/COMMIT/ROLLBACK) * Whether or not to enable transactions for this model (i.e. BEGIN/COMMIT/ROLLBACK)
* *
* @var boolean * @var boolean
* @access public
*/ */
var $transactional = false; var $transactional = false;
@ -202,6 +211,7 @@ class Model extends Object{
* caching only, the results are not stored beyond this execution. * caching only, the results are not stored beyond this execution.
* *
* @var boolean * @var boolean
* @access public
*/ */
var $cacheQueries = true; var $cacheQueries = true;
@ -209,6 +219,7 @@ class Model extends Object{
* belongsTo association * belongsTo association
* *
* @var array * @var array
* @access public
*/ */
var $belongsTo = array(); var $belongsTo = array();
@ -216,6 +227,7 @@ class Model extends Object{
* hasOne association * hasOne association
* *
* @var array * @var array
* @access public
*/ */
var $hasOne = array(); var $hasOne = array();
@ -223,6 +235,7 @@ class Model extends Object{
* hasMany association * hasMany association
* *
* @var array * @var array
* @access public
*/ */
var $hasMany = array(); var $hasMany = array();
@ -230,13 +243,15 @@ class Model extends Object{
* hasAndBelongsToMany association * hasAndBelongsToMany association
* *
* @var array * @var array
* @access public
*/ */
var $hasAndBelongsToMany = array(); var $hasAndBelongsToMany = array();
/** /**
* Depth of recursive association * Depth of recursive association
* *
* @var int * @var integer
* @access public
*/ */
var $recursive = 1; var $recursive = 1;
@ -251,6 +266,7 @@ class Model extends Object{
* Default association keys * Default association keys
* *
* @var array * @var array
* @access protected
*/ */
var $__associationKeys = array( var $__associationKeys = array(
'belongsTo' => array('className', 'conditions', 'order', 'foreignKey', 'counterCache'), 'belongsTo' => array('className', 'conditions', 'order', 'foreignKey', 'counterCache'),
@ -263,30 +279,31 @@ class Model extends Object{
* Holds provided/generated association key names and other data for all associations * Holds provided/generated association key names and other data for all associations
* *
* @var array * @var array
* @access protected
*/ */
var $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); var $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
/** /**
* The last inserted ID of the data that this model created * The last inserted ID of the data that this model created
* *
* @var int * @var integer
* @access private * @access protected
*/ */
var $__insertID = null; var $__insertID = null;
/** /**
* The number of records returned by the last query * The number of records returned by the last query
* *
* @access private * @var integer
* @var int * @access protected
*/ */
var $__numRows = null; var $__numRows = null;
/** /**
* The number of records affected by the last query * The number of records affected by the last query
* *
* @access private * @var integer
* @var int * @access protected
*/ */
var $__affectedRows = null; var $__affectedRows = null;
@ -353,12 +370,12 @@ class Model extends Object{
* PHP4 Only * PHP4 Only
* *
* Handles custom method calls, like findBy<field> for DB models, * Handles custom method calls, like findBy<field> for DB models,
* and custom RPC calls for remote data sources * and custom RPC calls for remote data sources.
* *
* @param unknown_type $method * @param string $method Name of method to call.
* @param unknown_type $params * @param array $params Parameters for the method.
* @param unknown_type $return * @param array $return The database query results, "returned" by reference.
* @return unknown * @return boolean Always true
* @access protected * @access protected
*/ */
function __call($method, $params, &$return) { function __call($method, $params, &$return) {
@ -368,9 +385,10 @@ class Model extends Object{
} }
/** /**
* Bind model associations on the fly. * Bind model associations on the fly.
* @link http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/
* *
* @param array $params * @param array $params
* @return true * @return boolean Always true
*/ */
function bindModel($params) { function bindModel($params) {
@ -395,8 +413,15 @@ class Model extends Object{
/** /**
* Turn off associations on the fly. * Turn off associations on the fly.
* *
* Example: Turn off the associated Model Supportrequest,
* to temporarily lighten the User model:
* <code>
* $this->User->unbindModel( array('hasMany' => array('Supportrequest')) );
* </code>
*
* @link http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/
* @param array $params * @param array $params
* @return true * @return boolean Always true
*/ */
function unbindModel($params) { function unbindModel($params) {
foreach($params as $assoc => $models) { foreach($params as $assoc => $models) {
@ -455,7 +480,6 @@ class Model extends Object{
* Private helper method to create associated models of given class. * Private helper method to create associated models of given class.
* @param string $assoc * @param string $assoc
* @param string $className Class name * @param string $className Class name
* @param string $type Type of assocation
* @access private * @access private
*/ */
function __constructLinkedModel($assoc, $className, $id = false, $table = null, $ds = null) { function __constructLinkedModel($assoc, $className, $id = false, $table = null, $ds = null) {
@ -638,7 +662,7 @@ class Model extends Object{
* Returns the column type of a column in the model * Returns the column type of a column in the model
* *
* @param string $column The name of the model column * @param string $column The name of the model column
* @return string * @return string Column type
*/ */
function getColumnType($column) { function getColumnType($column) {
$columns = $this->loadInfo(); $columns = $this->loadInfo();

View file

@ -83,7 +83,7 @@ class Model extends Object {
/** /**
* Value of the primary key ID of the record that this model is currently pointing to * Value of the primary key ID of the record that this model is currently pointing to
* *
* @var unknown_type * @var integer
* @access public * @access public
*/ */
var $id = false; var $id = false;
@ -125,12 +125,14 @@ class Model extends Object {
* that have to match with preg_match(). Use these rules with Model::validate() * that have to match with preg_match(). Use these rules with Model::validate()
* *
* @var array * @var array
* @access public
*/ */
var $validate = array(); var $validate = array();
/** /**
* Errors in validation * Errors in validation
* @var array * @var array
* @access public
*/ */
var $validationErrors = array(); var $validationErrors = array();
@ -138,6 +140,7 @@ class Model extends Object {
* Database table prefix for tables in model. * Database table prefix for tables in model.
* *
* @var string * @var string
* @access public
*/ */
var $tablePrefix = null; var $tablePrefix = null;
@ -159,6 +162,7 @@ class Model extends Object {
* List of table names included in the Model description. Used for associations. * List of table names included in the Model description. Used for associations.
* *
* @var array * @var array
* @access public
*/ */
var $tableToModel = array(); var $tableToModel = array();
@ -166,6 +170,7 @@ class Model extends Object {
* List of Model names by used tables. Used for associations. * List of Model names by used tables. Used for associations.
* *
* @var array * @var array
* @access public
*/ */
var $modelToTable = array(); var $modelToTable = array();
@ -173,6 +178,7 @@ class Model extends Object {
* List of Foreign Key names to used tables. Used for associations. * List of Foreign Key names to used tables. Used for associations.
* *
* @var array * @var array
* @access public
*/ */
var $keyToTable = array(); var $keyToTable = array();
@ -180,6 +186,7 @@ class Model extends Object {
* Alias table names for model, for use in SQL JOIN statements. * Alias table names for model, for use in SQL JOIN statements.
* *
* @var array * @var array
* @access public
*/ */
var $alias = array(); var $alias = array();
@ -187,6 +194,7 @@ class Model extends Object {
* Whether or not transactions for this model should be logged * Whether or not transactions for this model should be logged
* *
* @var boolean * @var boolean
* @access public
*/ */
var $logTransactions = false; var $logTransactions = false;
@ -194,6 +202,7 @@ class Model extends Object {
* Whether or not to enable transactions for this model (i.e. BEGIN/COMMIT/ROLLBACK) * Whether or not to enable transactions for this model (i.e. BEGIN/COMMIT/ROLLBACK)
* *
* @var boolean * @var boolean
* @access public
*/ */
var $transactional = false; var $transactional = false;
@ -202,6 +211,7 @@ class Model extends Object {
* caching only, the results are not stored beyond this execution. * caching only, the results are not stored beyond this execution.
* *
* @var boolean * @var boolean
* @access public
*/ */
var $cacheQueries = true; var $cacheQueries = true;
@ -209,6 +219,7 @@ class Model extends Object {
* belongsTo association * belongsTo association
* *
* @var array * @var array
* @access public
*/ */
var $belongsTo = array(); var $belongsTo = array();
@ -216,6 +227,7 @@ class Model extends Object {
* hasOne association * hasOne association
* *
* @var array * @var array
* @access public
*/ */
var $hasOne = array(); var $hasOne = array();
@ -223,6 +235,7 @@ class Model extends Object {
* hasMany association * hasMany association
* *
* @var array * @var array
* @access public
*/ */
var $hasMany = array(); var $hasMany = array();
@ -230,13 +243,15 @@ class Model extends Object {
* hasAndBelongsToMany association * hasAndBelongsToMany association
* *
* @var array * @var array
* @access public
*/ */
var $hasAndBelongsToMany = array(); var $hasAndBelongsToMany = array();
/** /**
* Depth of recursive association * Depth of recursive association
* *
* @var int * @var integer
* @access public
*/ */
var $recursive = 1; var $recursive = 1;
@ -251,6 +266,7 @@ class Model extends Object {
* Default association keys * Default association keys
* *
* @var array * @var array
* @access protected
*/ */
var $__associationKeys = array( var $__associationKeys = array(
'belongsTo' => array('className', 'conditions', 'order', 'foreignKey', 'counterCache'), 'belongsTo' => array('className', 'conditions', 'order', 'foreignKey', 'counterCache'),
@ -263,30 +279,31 @@ class Model extends Object {
* Holds provided/generated association key names and other data for all associations * Holds provided/generated association key names and other data for all associations
* *
* @var array * @var array
* @access protected
*/ */
var $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); var $__associations = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
/** /**
* The last inserted ID of the data that this model created * The last inserted ID of the data that this model created
* *
* @var int * @var integer
* @access private * @access protected
*/ */
var $__insertID = null; var $__insertID = null;
/** /**
* The number of records returned by the last query * The number of records returned by the last query
* *
* @access private * @var integer
* @var int * @access protected
*/ */
var $__numRows = null; var $__numRows = null;
/** /**
* The number of records affected by the last query * The number of records affected by the last query
* *
* @access private * @var integer
* @var int * @access protected
*/ */
var $__affectedRows = null; var $__affectedRows = null;
@ -350,10 +367,10 @@ class Model extends Object {
} }
/** /**
* Handles custom method calls, like findBy<field> for DB models, * Handles custom method calls, like findBy<field> for DB models,
* and custom RPC calls for remote data sources * and custom RPC calls for remote data sources.
* *
* @param unknown_type $method * @param string $method Name of method to call.
* @param array $params * @param array $params Parameters for the method.
* @return unknown * @return unknown
* @access protected * @access protected
*/ */
@ -363,9 +380,10 @@ class Model extends Object {
} }
/** /**
* Bind model associations on the fly. * Bind model associations on the fly.
* @link http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/
* *
* @param array $params * @param array $params
* @return true * @return boolean Always true
*/ */
function bindModel($params) { function bindModel($params) {
@ -390,8 +408,15 @@ class Model extends Object {
/** /**
* Turn off associations on the fly. * Turn off associations on the fly.
* *
* Example: Turn off the associated Model Supportrequest,
* to temporarily lighten the User model:
* <code>
* $this->User->unbindModel( array('hasMany' => array('Supportrequest')) );
* </code>
*
* @link http://cakebaker.wordpress.com/2006/02/22/new-feature-bindmodelunbindmodel/
* @param array $params * @param array $params
* @return true * @return boolean Always true
*/ */
function unbindModel($params) { function unbindModel($params) {
foreach($params as $assoc => $models) { foreach($params as $assoc => $models) {
@ -449,7 +474,6 @@ class Model extends Object {
* Private helper method to create associated models of given class. * Private helper method to create associated models of given class.
* @param string $assoc * @param string $assoc
* @param string $className Class name * @param string $className Class name
* @param string $type Type of assocation
* @param mixed $id Primary key ID of linked model * @param mixed $id Primary key ID of linked model
* @param string $table Database table associated with linked model * @param string $table Database table associated with linked model
* @param string $ds Name of DataSource the model should be bound to * @param string $ds Name of DataSource the model should be bound to
@ -635,7 +659,7 @@ class Model extends Object {
* Returns the column type of a column in the model * Returns the column type of a column in the model
* *
* @param string $column The name of the model column * @param string $column The name of the model column
* @return string * @return string Column type
*/ */
function getColumnType($column) { function getColumnType($column) {
$columns = $this->loadInfo(); $columns = $this->loadInfo();