/**
  * @param \SimpleXMLElement $entityXml
  * @return AlmEntity
  */
 public function extract(\SimpleXMLElement $entityXml)
 {
     $entity = new AlmEntity($entityXml->attributes()->Type);
     $entityXml = $entityXml->Fields[0];
     foreach ($entityXml->Field as $field) {
         if (trim((string) $field->Value[0]) !== '') {
             $entity->setParameter((string) $field->attributes()->Name, $field->Value[0], false);
         }
     }
     return $entity;
 }
Example #2
0
 /**
  * @param AlmEntity $entity
  * @throws Exception\AlmCurlException
  * @throws Exception\AlmException
  */
 public function checkInEntity(AlmEntity $entity)
 {
     $this->curl->setHeaders(array('POST /HTTP/1.1'))->setPost()->exec($this->routes->getEntityCheckinUrl($entity->getTypePluralized(), $entity->id));
 }