ValidationLogicCriteria::getMasterList PHP Method

getMasterList() public method

Gets a list of all the master fields in this criteria set
public getMasterList ( ) : string
return string
    public function getMasterList()
    {
        $list = array();
        foreach ($this->getCriteria() as $c) {
            if ($c instanceof ValidationLogicCriteria) {
                $list += $c->getMasterList();
            } else {
                $list[] = $c->getMaster();
            }
        }
        return $list;
    }

Usage Example

 public function onBeforeRender($field)
 {
     if (!$this->validationLogicCriteria) {
         return;
     }
     $masters = array_unique($this->validationLogicCriteria->getMasterList());
     if (count($masters)) {
         $this->owner->setAttribute('data-validation-logic-masters', implode(',', $masters));
         $this->owner->setAttribute('data-validation-logic-eval', $this->validationLogicCriteria->toScript());
     }
 }