mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 04:37:42 +08:00
Fix phpdoc of yii\base\Model (#18888)
This commit is contained in:
@ -335,9 +335,9 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
|
|||||||
* Errors found during the validation can be retrieved via [[getErrors()]],
|
* Errors found during the validation can be retrieved via [[getErrors()]],
|
||||||
* [[getFirstErrors()]] and [[getFirstError()]].
|
* [[getFirstErrors()]] and [[getFirstError()]].
|
||||||
*
|
*
|
||||||
* @param string[]|string $attributeNames attribute name or list of attribute names that should be validated.
|
* @param string[]|string|null $attributeNames attribute name or list of attribute names
|
||||||
* If this parameter is empty, it means any attribute listed in the applicable
|
* that should be validated. If this parameter is empty, it means any attribute listed in
|
||||||
* validation rules should be validated.
|
* the applicable validation rules should be validated.
|
||||||
* @param bool $clearErrors whether to call [[clearErrors()]] before performing validation
|
* @param bool $clearErrors whether to call [[clearErrors()]] before performing validation
|
||||||
* @return bool whether the validation is successful without any error.
|
* @return bool whether the validation is successful without any error.
|
||||||
* @throws InvalidArgumentException if the current scenario is unknown.
|
* @throws InvalidArgumentException if the current scenario is unknown.
|
||||||
@ -426,7 +426,7 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the validators applicable to the current [[scenario]].
|
* Returns the validators applicable to the current [[scenario]].
|
||||||
* @param string $attribute the name of the attribute whose applicable validators should be returned.
|
* @param string|null $attribute the name of the attribute whose applicable validators should be returned.
|
||||||
* If this is null, the validators for ALL attributes in the model will be returned.
|
* If this is null, the validators for ALL attributes in the model will be returned.
|
||||||
* @return \yii\validators\Validator[] the validators applicable to the current [[scenario]].
|
* @return \yii\validators\Validator[] the validators applicable to the current [[scenario]].
|
||||||
*/
|
*/
|
||||||
@ -561,10 +561,9 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the errors for all attributes or a single attribute.
|
* Returns the errors for all attributes or a single attribute.
|
||||||
* @param string $attribute attribute name. Use null to retrieve errors for all attributes.
|
* @param string|null $attribute attribute name. Use null to retrieve errors for all attributes.
|
||||||
* @property array An array of errors for all attributes. Empty array is returned if no error.
|
|
||||||
* The result is a two-dimensional array. See [[getErrors()]] for detailed description.
|
|
||||||
* @return array errors for all attributes or the specified attribute. Empty array is returned if no error.
|
* @return array errors for all attributes or the specified attribute. Empty array is returned if no error.
|
||||||
|
* See [[getErrors()]] for detailed description.
|
||||||
* Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:
|
* Note that when returning errors for all attributes, the result is a two-dimensional array, like the following:
|
||||||
*
|
*
|
||||||
* ```php
|
* ```php
|
||||||
@ -704,7 +703,7 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns attribute values.
|
* Returns attribute values.
|
||||||
* @param array $names list of attributes whose value needs to be returned.
|
* @param array|null $names list of attributes whose value needs to be returned.
|
||||||
* Defaults to null, meaning all attributes listed in [[attributes()]] will be returned.
|
* Defaults to null, meaning all attributes listed in [[attributes()]] will be returned.
|
||||||
* If it is an array, only the attributes in the array will be returned.
|
* If it is an array, only the attributes in the array will be returned.
|
||||||
* @param array $except list of attributes whose value should NOT be returned.
|
* @param array $except list of attributes whose value should NOT be returned.
|
||||||
@ -857,7 +856,7 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
|
|||||||
* Note, that the data being populated is subject to the safety check by [[setAttributes()]].
|
* Note, that the data being populated is subject to the safety check by [[setAttributes()]].
|
||||||
*
|
*
|
||||||
* @param array $data the data array to load, typically `$_POST` or `$_GET`.
|
* @param array $data the data array to load, typically `$_POST` or `$_GET`.
|
||||||
* @param string $formName the form name to use to load the data into the model.
|
* @param string|null $formName the form name to use to load the data into the model, empty string when form not use.
|
||||||
* If not set, [[formName()]] is used.
|
* If not set, [[formName()]] is used.
|
||||||
* @return bool whether `load()` found the expected form in `$data`.
|
* @return bool whether `load()` found the expected form in `$data`.
|
||||||
*/
|
*/
|
||||||
@ -887,7 +886,7 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
|
|||||||
* @param array $models the models to be populated. Note that all models should have the same class.
|
* @param array $models the models to be populated. Note that all models should have the same class.
|
||||||
* @param array $data the data array. This is usually `$_POST` or `$_GET`, but can also be any valid array
|
* @param array $data the data array. This is usually `$_POST` or `$_GET`, but can also be any valid array
|
||||||
* supplied by end user.
|
* supplied by end user.
|
||||||
* @param string $formName the form name to be used for loading the data into the models.
|
* @param string|null $formName the form name to be used for loading the data into the models.
|
||||||
* If not set, it will use the [[formName()]] value of the first model in `$models`.
|
* If not set, it will use the [[formName()]] value of the first model in `$models`.
|
||||||
* This parameter is available since version 2.0.1.
|
* This parameter is available since version 2.0.1.
|
||||||
* @return bool whether at least one of the models is successfully populated.
|
* @return bool whether at least one of the models is successfully populated.
|
||||||
@ -923,7 +922,7 @@ class Model extends Component implements StaticInstanceInterface, IteratorAggreg
|
|||||||
* This method will validate every model. The models being validated may
|
* This method will validate every model. The models being validated may
|
||||||
* be of the same or different types.
|
* be of the same or different types.
|
||||||
* @param array $models the models to be validated
|
* @param array $models the models to be validated
|
||||||
* @param array $attributeNames list of attribute names that should be validated.
|
* @param array|null $attributeNames list of attribute names that should be validated.
|
||||||
* If this parameter is empty, it means any attribute listed in the applicable
|
* If this parameter is empty, it means any attribute listed in the applicable
|
||||||
* validation rules should be validated.
|
* validation rules should be validated.
|
||||||
* @return bool whether all models are valid. False will be returned if one
|
* @return bool whether all models are valid. False will be returned if one
|
||||||
|
|||||||
Reference in New Issue
Block a user