예제 #1
0
 public function testTransformationException()
 {
     $this->setExpectedException(ApiTransformationException::class);
     $transformer = new ItemTransformer();
     $rawItem = '{"name": "name1", "description": "description1", "price1":"222"}';
     $transformer->transform($rawItem, 1);
 }
예제 #2
0
파일: Items.php 프로젝트: holgergr/api
 /**
  * @param string $rawItem
  * @param null $id
  * @return Item
  */
 public function transformToEntity($rawItem, $id = null)
 {
     $transformer = new ItemTransformer();
     return $transformer->transform($rawItem, $id);
 }