Created
October 7, 2016 06:44
-
-
Save alezhu/4c73ba2aaa65c81bb1e61555effe842b to your computer and use it in GitHub Desktop.
Simple Doctrine 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
use Doctrine\Common\Annotations\Annotation; | |
use Doctrine\Common\Annotations\Annotation\Target; | |
/** | |
* Class Action | |
* @package App\Core | |
* @Annotation() | |
* @Target("METHOD") | |
*/ | |
class CheckAction | |
{ | |
public $value; | |
/** | |
* Action constructor. | |
* @param $value | |
*/ | |
public function __construct($value) | |
{ | |
if (is_array($value)) { | |
if (isset($value['value'])) { | |
$this->value = $value['value']; | |
} else if (isset($value[0])) { | |
$this->value = $value[0]; | |
} else { | |
$this->value = $value; | |
} | |
} else { | |
$this->value = $value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment