Пример #1
0
 /**
  * Get formated datas for a collection.
  *
  * @param \Subbly\Model\Collection $collection
  *
  * @return \Illuminate\Support\Collection
  */
 public function collection(Collection $collection)
 {
     $entries = new Entries();
     foreach ($collection as $order) {
         $entry = new Entry($order);
         $entry->field('id')->field('firstname')->field('lastname')->field('address1')->field('address2')->field('zipcode')->field('city')->field('country')->field('phone_work')->field('phone_home')->field('phone_mobile')->field('other_informations');
         $entries->addEntry($entry);
     }
     return $entries->toArray();
 }
Пример #2
0
 /**
  * Get formated datas for a collection.
  *
  * @param \Subbly\Model\Collection $collection
  *
  * @return \Illuminate\Support\Collection
  */
 public function collection(Collection $collection)
 {
     $entries = new Entries();
     foreach ($collection as $category) {
         $entry = new Entry($category);
         $entry->field('id')->field('label')->field('slug')->field('parent')->field('position');
         $entries->addEntry($entry);
     }
     return $entries->toArray();
 }
Пример #3
0
 /**
  * Get formated datas for a collection.
  *
  * @param \Subbly\Model\Collection $collection
  *
  * @return \Illuminate\Support\Collection
  */
 public function collection(Collection $collection)
 {
     $entries = new Entries();
     foreach ($collection as $product) {
         $entry = new Entry($product);
         $entry->field('id')->field('name')->field('description')->field('sku')->field('status')->field('price')->field('sale_price')->field('quantity')->value('image', $product->product->defaultImage())->dateField('created_at')->dateField('updated_at');
         $entries->addEntry($entry);
     }
     return $entries->toArray();
 }