Open
Description
If you have an alias defined for an attribute, and also have a custom setter defined for that attribute, then the custom setter is not run when setting the aliased attribute.
Example:
class Person extends ActiveRecord\Model {
static $alias_attribute = array(
'name' => 'customer_name'
)
public function set_customer_name($customer_name) {
$this->assign_attribute('customer_name', strtoupper($customer_name));
}
}
# $person = new Person()
# $person->customer_name = "john doe";
# => "JOHN DOE"
# $person->name = "john doe";
# => "john doe"
Metadata
Metadata
Assignees
Labels
No labels