Exemple #1
0
 public function createString()
 {
     $result = "";
     if (!empty($this->modifierList)) {
         $result .= " SET ";
         $statementList = array();
         foreach ($this->modifierList as $fieldName => $newValue) {
             if ($newValue instanceof ARExpressionHandle) {
                 $value = $newValue->toString();
             } else {
                 $value = "'" . $newValue . "'";
             }
             $statementList[] = $fieldName . " = " . $value;
         }
         $result .= implode(", ", $statementList);
     }
     $result .= parent::createString();
     return $result;
 }
Exemple #2
0
 private function appendRelatedRecordJoinCond($foreignClassName, ARFilter $filter)
 {
     $foreignSchema = self::getSchemaInstance($foreignClassName);
     $callerClassName = get_class($this);
     $referenceFieldName = "";
     $id = $this->getID();
     if (is_null($id)) {
         throw new ARException("Related record set can be loaded only by a persisted object (so it must have a record ID)");
     }
     foreach ($foreignSchema->getForeignKeyList() as $name => $field) {
         if ($field->getForeignClassName() == $callerClassName) {
             $filter->mergeCondition(new EqualsCond(new ARFieldHandle($foreignClassName, $name), $id));
             return;
         }
     }
     throw new ARSchemaException("Reference from " . $foreignClassName . " to " . $callerClassName . " is not defined in schema");
 }
Exemple #3
0
 public function createPreparedStatement()
 {
     $sql = parent::createPreparedStatement();
     $sql['sql'] .= $this->getParamsSQL();
     return $sql;
 }