MetaModels\Attribute\BaseSimple::handleMetaChange PHP Метод

handleMetaChange() публичный Метод

This tells the attribute to perform any actions that must be done to correctly initialize the new value and to perform any action to undo the changes that had been done for the previous value. i.e.: when an attribute type needs columns in an an auxiliary table, these will have to be updated herein. This method may throw an exception, when the new value is invalid or any problems appear, the MetaModelAttribute will then keep the old meta value.
public handleMetaChange ( string $strMetaName, mixed $varNewValue ) : MetaModels\Attribute\IAttribute
$strMetaName string Name of the meta information that shall be updated.
$varNewValue mixed The new value for this meta information.
Результат MetaModels\Attribute\IAttribute The instance of this attribute, to support chaining.
    public function handleMetaChange($strMetaName, $varNewValue)
    {
        // By default we accept any change of meta information.
        if ($strMetaName == 'colname') {
            if ($this->get($strMetaName) != $varNewValue) {
                $this->renameColumn($varNewValue);
            }
            return $this;
        }
        return parent::handleMetaChange($strMetaName, $varNewValue);
    }