Commit 51fbbb05 authored by zYne's avatar zYne

AccessorInvoker code example

parent 6e7cc432
<?php
class User {
public function setTableDefinition() {
$this->hasColumn("name", "string", 200);
$this->hasColumn("password", "string", 32);
}
public function setPassword($password) {
return md5($password);
}
public function getName($name) {
return strtoupper($name);
}
}
$user = new User();
$user->name = 'someone';
print $user->name; // someone
$user->password = '123';
print $user->password; // 123
$user->setAttribute(Doctrine::ATTR_LISTENER, new Doctrine_EventListener_AccessorInvoker());
print $user->name; // SOMEONE
$user->password = '123';
print $user->password; // 202cb962ac59075b964b07152d234b70
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment