/**
  * {@inheritDoc}
  */
 public function buildRules()
 {
     $rules = [];
     foreach ($this->entityHelper->getProperties($this->context) as $property) {
         $condition = new AttributeCondition();
         $condition->setName(ucfirst($property['fieldName']))->setEntity($this->context)->setAttribute($property['fieldName'])->setType($property['type']);
         $rules[] = $condition;
     }
     foreach ($this->entityHelper->getRelations($this->context) as $key => $relation) {
         foreach ($this->entityHelper->getProperties($relation['targetEntity']) as $relProperty) {
             $condition = new RelationCondition();
             $condition->setName(ucfirst($key) . ' ' . ucfirst($relProperty['fieldName']))->setRelation($key)->setEntity($relation['targetEntity'])->setAttribute($relProperty['fieldName'])->setType($relProperty['type']);
             $rules[] = $condition;
         }
     }
     return $rules;
 }