Created
November 14, 2013 02:45
-
-
Save simkimsia/7460467 to your computer and use it in GitHub Desktop.
Example of the template Behavior from https://gist.github.com/simkimsia/7460428
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 | |
| /** | |
| * ReplaceableBehavior class file. | |
| * | |
| * Replaces `unicorn` in an array with `super_duper_unicorn` | |
| * | |
| * Usage is straightforward: | |
| * In model: $array = $this->replaceWithSuper($array); | |
| * | |
| * Copyright 2013, Kim Stacks | |
| * Singapore | |
| * | |
| * Licensed under The MIT License | |
| * Redistributions of files must retain the above copyright notice. | |
| * | |
| * @copyright Copyright 2013, Kim Stacks. | |
| * @link http://stacktogether.com | |
| * @author Kim Stacks <kim@stacktogether.com> | |
| * @license http://www.opensource.org/licenses/mit-license.php The MIT License | |
| * @package SuperDuperMakeUnicorns | |
| * @subpackage SuperDuperMakeUnicorns.Model.Behavior | |
| * @version 0.1.0 | |
| */ | |
| class ReplaceableBehavior extends ModelBehavior { | |
| /** | |
| * Behavior settings | |
| * | |
| * @access public | |
| * @var array | |
| */ | |
| public $settings = array(); | |
| /** | |
| * Initiate behavior for the model using specified settings. | |
| * | |
| * @param Model $Model | |
| * @param array $config | |
| * @return void | |
| */ | |
| public function setup(Model $Model, $settings = array()) { | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment