Skip to content

Instantly share code, notes, and snippets.

@filhodanuvem
Created January 18, 2012 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filhodanuvem/1633679 to your computer and use it in GitHub Desktop.
Save filhodanuvem/1633679 to your computer and use it in GitHub Desktop.
Simple example Annotation
<?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