예제 #1
0
파일: Delete.php 프로젝트: harp-orm/harp
 public function models(Models $models)
 {
     $key = $this->getRepo()->getPrimaryKey();
     $ids = $models->pluckProperty($key);
     $this->whereIn($key, $ids);
     return $this;
 }
예제 #2
0
 /**
  * @covers ::pluckProperty
  */
 public function testPluckProperty()
 {
     $models = new Models([new City(['id' => 10, 'name' => 'test1']), new City(['id' => 20, 'name' => 'test2'])]);
     $expected = [10, 20];
     $this->assertSame($expected, $models->pluckProperty('id'));
     $expected = ['test1', 'test2'];
     $this->assertSame($expected, $models->pluckProperty('name'));
 }