base\Model offsetUnset()

offsetUnset() public method Sets the element value at the specified offset to null. This method is required by the SPL interface ArrayAccess. It is implicitly called when you use something like unset($model[$offset]). public void offsetUnset ( $offset )$offset mixed The offset to unset element

base\Model offsetSet()

offsetSet() public method Sets the element at the specified offset. This method is required by the SPL interface ArrayAccess. It is implicitly called when you use something like $model[$offset] = $item;. public void offsetSet ( $offset, $item )$offset integer The offset to set element $item mixed The element value

base\Model offsetGet()

offsetGet() public method Returns the element at the specified offset. This method is required by the SPL interface ArrayAccess. It is implicitly called when you use something like $value = $model[$offset];. public mixed offsetGet ( $offset )$offset mixed The offset to retrieve element. return mixed The element at the offset, null if no element is found at the offset

base\Model offsetExists()

offsetExists() public method Returns whether there is an element at the specified offset. This method is required by the SPL interface ArrayAccess. It is implicitly called when you use something like isset($model[$offset]). public boolean offsetExists ( $offset )$offset mixed The offset to check on. return boolean Whether or not an offset exists.

base\Model loadMultiple()

loadMultiple() public static method Populates a set of models with the data from end user. This method is mainly used to collect tabular data input. The data to be loaded for each model is $data[formName][index], where formName refers to the value of formName(), and index the index of the model in the $models array. If formName() is empty, $data[index] will be used to populate each model. The data being populated to each model is subject to the safety check by setAttributes(). public stat

base\Model load()

load() public method Populates the model with input data. This method provides a convenient shortcut for: if (isset($_POST['FormName'])) { $model->attributes = $_POST['FormName']; if ($model->save()) { // handle success } } which, with load() can be written as: if ($model->load($_POST) && $model->save()) { // handle success } load() gets the 'FormName' from the model's formName() method (which you may override), unless the $formName parameter is

base\Model isAttributeSafe()

isAttributeSafe() public method Returns a value indicating whether the attribute is safe for massive assignments. See also safeAttributes(). public boolean isAttributeSafe ( $attribute )$attribute string Attribute name return boolean Whether the attribute is safe for massive assignments

base\Model isAttributeRequired()

isAttributeRequired() public method Returns a value indicating whether the attribute is required. This is determined by checking if the attribute is associated with a required validation rule in the current $scenario. Note that when the validator has a conditional validation applied using $when this method will return false regardless of the when condition because it may be called be before the model is loaded with data. public boolean isAttributeRequired ( $attribute )$attribute string

base\Model isAttributeActive()

isAttributeActive() public method Returns a value indicating whether the attribute is active in the current scenario. See also activeAttributes(). public boolean isAttributeActive ( $attribute )$attribute string Attribute name return boolean Whether the attribute is active in the current scenario

base\Model hasErrors()

hasErrors() public method Returns a value indicating whether there is any validation error. public boolean hasErrors ( $attribute = null )$attribute string|null Attribute name. Use null to check all attributes. return boolean Whether there is any error.