Ejemplo n.º 1
0
 public function handle(CreateBehaviorDO $do)
 {
     $entity = new Model();
     $entity->store()->associate($this->loadStoreById($do->store_id));
     $entity->name = $do->name;
     $entity->label = $do->label;
     $entity->save();
 }
Ejemplo n.º 2
0
 public function build(Model $entity = null)
 {
     $do = new DataObject();
     if ($entity) {
         $entityData = $entity->toArray();
         $entityData['attributes'] = $this->attributeBuilder->buildThem($entity->attributes);
         $do->update($entityData);
     }
     return $do;
 }