| @@ 614-631 (lines=18) @@ | ||
| 611 | * |
|
| 612 | * @return string|false method name if it exists |
|
| 613 | */ |
|
| 614 | public static function getMutator($property) |
|
| 615 | { |
|
| 616 | $class = get_called_class(); |
|
| 617 | ||
| 618 | $k = $class.':'.$property; |
|
| 619 | if (!array_key_exists($k, self::$mutators)) { |
|
| 620 | $inflector = Inflector::get(); |
|
| 621 | $method = 'set'.$inflector->camelize($property).'Value'; |
|
| 622 | ||
| 623 | if (!method_exists($class, $method)) { |
|
| 624 | $method = false; |
|
| 625 | } |
|
| 626 | ||
| 627 | self::$mutators[$k] = $method; |
|
| 628 | } |
|
| 629 | ||
| 630 | return self::$mutators[$k]; |
|
| 631 | } |
|
| 632 | ||
| 633 | /** |
|
| 634 | * Gets the accessor method name for a given proeprty name. |
|
| @@ 642-659 (lines=18) @@ | ||
| 639 | * |
|
| 640 | * @return string|false method name if it exists |
|
| 641 | */ |
|
| 642 | public static function getAccessor($property) |
|
| 643 | { |
|
| 644 | $class = get_called_class(); |
|
| 645 | ||
| 646 | $k = $class.':'.$property; |
|
| 647 | if (!array_key_exists($k, self::$accessors)) { |
|
| 648 | $inflector = Inflector::get(); |
|
| 649 | $method = 'get'.$inflector->camelize($property).'Value'; |
|
| 650 | ||
| 651 | if (!method_exists($class, $method)) { |
|
| 652 | $method = false; |
|
| 653 | } |
|
| 654 | ||
| 655 | self::$accessors[$k] = $method; |
|
| 656 | } |
|
| 657 | ||
| 658 | return self::$accessors[$k]; |
|
| 659 | } |
|
| 660 | ||
| 661 | /** |
|
| 662 | * Marshals a value for a given property from storage. |
|