Esempio n. 1
0
 public function compile($aQuery)
 {
     $queryList = $this->stringToList($aQuery);
     $struc = new CompilerStructure();
     $this->errorString = "";
     $this->owner->debug($queryList, 2);
     if ($this->query($queryList, $struc)) {
         if (count($queryList) > 0) {
             if (stlen($this->errorString) > 0) {
                 $this->owner->writeLn($this->errorString);
             }
             return null;
         }
         $this->owner->debug("Structure: " . $struc->__toString(), 2);
         $this->substitutionList = array();
         return $this->structureToCode($struc);
     }
     if (strlen($this->errorString) > 0) {
         $this->owner->writeLn($this->errorString);
     }
     return null;
 }
Esempio n. 2
0
 function errors($value)
 {
     $errors = parent::errors($value);
     if (isset($this->options['length']) && $this->options['length']) {
         if (stlen($value) > $this->options['length']) {
             $errors[] = 'Must be under ' . $this->options['length'] . ' characters.';
         }
     }
     return $errors;
 }