예제 #1
0
 /**
  * Magic methods for getter and setter
  *
  * @param string $method The method to call
  * @param array $arguments The arguments to call
  *
  * @return mixed|bool
  */
 public function __call($method, $arguments)
 {
     $returnValue = '';
     $magicMethod = $this->evaluateMagicMethod($method);
     switch ($magicMethod) {
         case 'set':
             $this->set(String::lowerFirst(String::substring($method, 3)), $arguments[0]);
             $returnValue = $this->model;
             break;
         case 'get':
             $returnValue = $this->get(String::lowerFirst(substr($method, 3)));
             break;
     }
     return $returnValue;
 }
예제 #2
0
 /**
  *
  */
 public function testLowerFirst()
 {
     $this->assertEquals('aBc', String::lowerFirst('ABc'));
 }