51 lines
1.0 KiB
PHP
Executable File
51 lines
1.0 KiB
PHP
Executable File
<?php
|
|
|
|
class Field extends Entity {
|
|
|
|
protected static
|
|
$type,
|
|
$subType,
|
|
$rootType,
|
|
$parentType = 'Model';
|
|
|
|
protected function __construct ( $data, Model $parent = null ) {
|
|
|
|
parent::__construct($data, $parent);
|
|
|
|
}
|
|
|
|
public function invalid ( $value, $data = array() ) {
|
|
|
|
$class = 'Element' . ucfirst($this->data['value']['type']);
|
|
|
|
return $class::invalid($this->data['value'], $value, $data);
|
|
|
|
}
|
|
|
|
public function apply ( $value, $data = array() ) {
|
|
|
|
$class = 'Element' . ucfirst($this->data['value']['type']);
|
|
|
|
return $class::apply($this->data['value'], $value, $data);
|
|
|
|
}
|
|
|
|
public function unaryOperator ( $operator, $arg ) {
|
|
|
|
$class = 'Element' . ucfirst($this->data['value']['type']);
|
|
|
|
return $class::unaryOperator($this->data['value'], $operator, $arg);
|
|
|
|
}
|
|
|
|
public function binaryOperator ( $operator, $arg ) {
|
|
|
|
$class = 'Element' . ucfirst($this->data['value']['type']);
|
|
|
|
return $class::binaryOperator($this->data['value'], $operator, $arg1, $arg2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|