/**
  * Get a Property from Field by given Marker and Form
  *
  * @param string $marker Field Marker
  * @param Form $form
  * @param string $property Field Property
  * @return string Property
  */
 public function render($marker, Form $form, $property)
 {
     $field = $this->fieldRepository->findByMarkerAndForm($marker, $form->getUid());
     if ($field !== null) {
         return ObjectAccess::getProperty($field, $property);
     }
     return '';
 }
 /**
  * Read Label of a field from given UID
  *
  * @param string $marker Field Marker
  * @param \In2code\Powermail\Domain\Model\Form $form
  * @param string $property Field Property
  * @return string Property
  */
 public function render($marker, \In2code\Powermail\Domain\Model\Form $form, $property)
 {
     $field = $this->fieldRepository->findByMarkerAndForm($marker, $form->getUid());
     if (method_exists($field, 'get' . ucfirst($property))) {
         return $field->{'get' . ucfirst($property)}();
     }
     return '';
 }
 /**
  * @param string $marker
  * @param string $value
  * @param Form $form
  * @param int $pageUid
  * @return QueryResultInterface
  */
 public function findByMarkerValueForm($marker, $value, $form, $pageUid)
 {
     $query = $this->createQuery();
     $and = array($query->equals('answers.field', $this->fieldRepository->findByMarkerAndForm($marker, $form->getUid())), $query->equals('answers.value', $value), $query->equals('pid', $pageUid));
     $query->matching($query->logicalAnd($and));
     return $query->execute();
 }
示例#4
0
文件: Div.php 项目: advOpk/pwm
 /**
  * Return type from given field marker and form
  *
  * @param string $marker Field marker
  * @param integer $formUid Form UID
  * @return string Field Type
  */
 public function getFieldTypeFromMarker($marker, $formUid = 0)
 {
     $field = $this->fieldRepository->findByMarkerAndForm($marker, $formUid);
     if (method_exists($field, 'getType')) {
         return $field->getType();
     }
     return '';
 }