Ouzo\Utilities\Functions::extractId PHP Method

extractId() public static method

public static extractId ( )
    public static function extractId()
    {
        return function ($object) {
            /** @var \Ouzo\Model $object */
            return $object->getId();
        };
    }

Usage Example

Esempio n. 1
0
 /**
  * @test
  */
 public function shouldExtractId()
 {
     //given
     $product = new Product(array('id' => 1));
     //when
     $id = Functions::call(Functions::extractId(), $product);
     //then
     $this->assertEquals(1, $id);
 }
All Usage Examples Of Ouzo\Utilities\Functions::extractId