/**
  * @test
  */
 public function shouldParseTwoFields()
 {
     //given
     $method = 'findByShippingAddressPostalcodeAndName';
     //when
     $match = DynamicFinder::match($method);
     //then
     Assert::thatArray($match->getNames())->containsExactly('shipping_address_postalcode', 'name');
 }
Esempio n. 2
0
 public static function __callStatic($name, $arguments)
 {
     Session::checkSession();
     $dynamicFinder = DynamicFinder::match($name);
     if ($dynamicFinder) {
         $where = Arrays::combine($dynamicFinder->getNames(), $arguments);
         return static::where($where);
     }
     throw new BadMethodCallException('Method [' . $name . '] not exists');
 }