예제 #1
0
 /**
  * {@inheritdoc}
  */
 protected function build()
 {
     parent::build();
     $value = $this->get('value');
     if ($value) {
         $request = $this->getRequest();
         $request->setBody(json_encode($value));
         if ($this->jsonContentType && !$request->hasHeader('Content-Type')) {
             $request->setHeader('Content-Type', $this->jsonContentType);
         }
     }
 }
예제 #2
0
 protected function build()
 {
     parent::build();
     $entity = $this->get('entity');
     if ($entity) {
         if ($entity instanceof Entity) {
             $entity = $entity->toArray();
         }
         $request = $this->getRequest();
         $request->setBody(json_encode($entity));
         if ($this->jsonContentType && !$request->hasHeader('Content-Type')) {
             $request->setHeader('Content-Type', $this->jsonContentType);
         }
     }
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 protected function validate()
 {
     $this->validateEntity();
     parent::validate();
 }