Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function deleteRelationalCollection(Repository $repository, Event $event = null)
 {
     $repository->deleteRelation($this->relational->table(), $this->relational->relationIds(), null, [], $event);
     return $this->factory->makeRepresentationCreator()->make([], 204);
 }
Exemplo n.º 2
0
 function it_deletes_relations(Repository $repository, Response $response, Factory $factory, RepresentationCreator $representationCreator, Relational $relational)
 {
     $table = 'image_product_site';
     $relationIds = ['site_id' => 2, 'product_id' => 7];
     $itemColumn = 'image_id';
     $itemIds = [6, 7, 10];
     $relational->table()->shouldBeCalled()->willReturn($table);
     $relational->relationIds()->shouldBeCalled()->willReturn($relationIds);
     $relational->itemColumn()->shouldBeCalled()->willReturn($itemColumn);
     $relational->itemIds()->shouldBeCalled()->willReturn($itemIds);
     $repository->deleteRelation($table, $relationIds, $itemColumn, $itemIds, null)->shouldBeCalled();
     $factory->makeRepresentationCreator()->shouldBeCalled()->willReturn($representationCreator);
     $representationCreator->make([], 204)->shouldBeCalled()->willReturn($response);
     $this->deleteRelation($repository)->shouldReturn($response);
 }