@@ 158-171 (lines=14) @@ | ||
155 | * @param string $fieldType Field PHP type |
|
156 | * @return string Generated PHP method code |
|
157 | */ |
|
158 | protected function generateFieldConditionMethod($fieldName, $fieldId, $fieldType) |
|
159 | { |
|
160 | $code = "\n\t" . '/**'; |
|
161 | $code .= "\n\t" . ' * Add '.$fieldName.'(#' . $fieldId . ') field query condition.'; |
|
162 | $code .= "\n\t" . ' * @param '.Field::phpType($fieldType).' $value Field value'; |
|
163 | $code .= "\n\t" . ' * @return self Chaining'; |
|
164 | $code .= "\n\t" . ' * @see Generic::where()'; |
|
165 | $code .= "\n\t" . ' */'; |
|
166 | $code .= "\n\t" . 'public function ' . $fieldName . '($value)'; |
|
167 | $code .= "\n\t" . "{"; |
|
168 | $code .= "\n\t\t" . 'return $this->where("'.$fieldName.'", $value);'; |
|
169 | ||
170 | return $code . "\n\t" . "}"."\n"; |
|
171 | } |
|
172 | ||
173 | /** |
|
174 | * Generate Query::where() analog for specific field. |
|
@@ 181-194 (lines=14) @@ | ||
178 | * @param string $fieldType Field PHP type |
|
179 | * @return string Generated PHP method code |
|
180 | */ |
|
181 | protected function generateLocalizedFieldConditionMethod($fieldName, $fieldId, $fieldType) |
|
182 | { |
|
183 | $code = "\n\t" . '/**'; |
|
184 | $code .= "\n\t" . ' * Add '.$fieldName.'(#' . $fieldId . ') field query condition.'; |
|
185 | $code .= "\n\t" . ' * @param '.Field::phpType($fieldType).' $value Field value'; |
|
186 | $code .= "\n\t" . ' * @return self Chaining'; |
|
187 | $code .= "\n\t" . ' * @see Generic::where()'; |
|
188 | $code .= "\n\t" . ' */'; |
|
189 | $code .= "\n\t" . 'public function ' . $fieldName . '($value)'; |
|
190 | $code .= "\n\t" . "{"; |
|
191 | $code .= "\n\t\t" . 'return $this->where("'.$fieldName.'", $value);'; |
|
192 | ||
193 | return $code . "\n\t" . "}"."\n"; |
|
194 | } |
|
195 | ||
196 | /** |
|
197 | * Create entity PHP class code. |