Created
February 11, 2012 12:35
-
-
Save suin/1799221 to your computer and use it in GitHub Desktop.
モデルのインターフェースを定義してみる。 ref: http://qiita.com/items/2389
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 | |
interface ModelInterface | |
{ | |
/** | |
* Sets the value of a property. | |
* @param string $name | |
* @param mixed $value | |
* @return void | |
*/ | |
public function __set($name, $value); | |
/** | |
* Gets the value of a property. | |
* @param string $name | |
* @return mixed | |
*/ | |
public function __get($name); | |
/** | |
* Determines if a variable is set and is not NULL. | |
* @param string $name | |
* @return bool | |
*/ | |
public function __isset($name); | |
/** | |
* Sets the value of a property. | |
* @param string $name | |
* @param mixed $value | |
* @return ModelInterface | |
*/ | |
public function set($name, $value); | |
/** | |
* Gets the value of a property. | |
* @param string $name | |
* @return mixed | |
*/ | |
public function get($name); | |
/** | |
* Determines if a variable is set and is not NULL. | |
* @param string $name | |
* @return bool | |
*/ | |
public function defined($name); | |
/** | |
* Determines if a variable exists. | |
* @param string $name | |
* @return bool | |
*/ | |
public function exists($name); | |
/** | |
* Imports the values of properties. | |
* @param array $values | |
* @return ModelInterface | |
*/ | |
public function import(array $values); | |
/** | |
* Exports the values of all properties. | |
* @return array | |
*/ | |
public function export(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment