Created
January 18, 2012 15:53
-
-
Save filhodanuvem/1633679 to your computer and use it in GitHub Desktop.
Simple example Annotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo extends Model | |
{ | |
/** | |
* @var int | |
*/ | |
protected $value; | |
public function getValue(){ | |
return $this->value; | |
} | |
public function setValue($value){ | |
$this->value = $value; | |
} | |
// model with method savel that call filter from Annotation | |
} | |
?> | |
<?php | |
use Model as m; | |
$foo = new m\Foo(); | |
$foo->setValue(3); | |
$foo->save(); // here we have a array status {'value' => true } | |
// but if we doing ... | |
$foo->setValue(date(Y-m-d)); | |
$foo->save(); | |
// we have a array status {'value' => false } | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment