62 lines
1.1 KiB
PHP
Executable File
62 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
abstract class Index extends Entity implements IteratorAggregate {
|
|
|
|
protected static
|
|
$type,
|
|
$subType,
|
|
$rootType,
|
|
$parentType = 'Model';
|
|
|
|
|
|
public function getIterator () {
|
|
|
|
return $this->__get('Field');
|
|
|
|
}
|
|
|
|
final public function getField ( $name ) {
|
|
|
|
if ( empty($this->data['fields'][$name]) )
|
|
return null;
|
|
|
|
return Field::get($this->getParent()->getName(1) . '.' . $name);
|
|
|
|
}
|
|
|
|
final public function getFieldsData ( $name = null ) {
|
|
|
|
if ( $name && !empty($this->data['fields'][$name]) )
|
|
return $this->data['fields'][$name];
|
|
|
|
elseif ( $name )
|
|
return null;
|
|
|
|
return $this->data['fields'];
|
|
|
|
}
|
|
|
|
final public function getPositionField ( $position ) {
|
|
|
|
if ( empty($this->data['fields'][$position]) )
|
|
return null;
|
|
|
|
return $this->getField($this->data['fields'][$position]);
|
|
|
|
}
|
|
|
|
final public function getPositionFieldsData ( $position = null ) {
|
|
|
|
if ( $position && !empty($this->data['fields'][$position]) )
|
|
return $this->data['fields'][$this->data['fields'][$position]];
|
|
|
|
elseif ( $name )
|
|
return null;
|
|
|
|
return $this->data['fields'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|