Exemple #1
0
 /**
  * Delete the process passing request object
  *
  * @param Request $request Request that is used for this delete method, $request->getDataObject(0) will contain
  *                         query data to fetch the old object
  *
  * @return void
  */
 public function delete(Request $request)
 {
     /** @var \Tasker\Mapper\Process\Entity $mapper */
     $mapper = DbMapperFactory::make('process|entity');
     $mapper->setArrays($request->getData());
     $dbAttributesForQuery = $mapper->getMappedSecondAttributes();
     $processQuery = new ProcessQuery();
     // Get the old entity
     /** @var \Propel\Runtime\Collection\ObjectCollection $dbEntities */
     $dbEntities = $processQuery->findByArray($dbAttributesForQuery);
     /** @var \Tasker\DataGateway\Db\Entity\Process $dbEntity */
     $dbEntities->delete();
     // Return empty array that it will indicate a deleted collection to the caller
     $this->setEntitiesFromResponse([]);
 }