コード例 #1
0
ファイル: KeywordsTest.php プロジェクト: n10ty/api
 public function setUp()
 {
     $this->collection = new Keywords();
     foreach ($this->keywords as $keyword) {
         $object = $this->hydrate(new Keyword(), $keyword);
         $this->collection->addKeyword($object);
     }
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function createCollection(array $data = [])
 {
     $collection = new Keywords();
     if (array_key_exists('keywords', $data)) {
         $data = $data['keywords'];
     }
     foreach ($data as $item) {
         $collection->addKeyword($this->create($item));
     }
     return $collection;
 }