* @package tao */ abstract class tao_actions_form_Generis extends tao_helpers_form_FormContainer { // --- ASSOCIATIONS --- // --- ATTRIBUTES --- /** * The uri of the default top level class * used by default to limit the recursivity level in the ontology * * @access protected * @var string */ const DEFAULT_TOP_CLASS = 'http://www.tao.lu/Ontologies/TAO.rdf#TAOObject'; /** * used to define a top level class * * @access protected * @var Class */ protected $topClazz = null; /** * the class resource to create the form from * * @access protected * @var Class */ protected $clazz = null; /** * the resource to create the form from * * @access protected * @var Resource */ protected $instance = null; // --- OPERATIONS --- /** * constructor, set the ontology's class, resource and the form options * * @access public * @author Bertrand Chevrier, * @param Class clazz * @param Resource instance * @param array options * @return mixed */ public function __construct(core_kernel_classes_Class $clazz, core_kernel_classes_Resource $instance = null, $options = []) { $this->clazz = $clazz; $this->instance = $instance; if (isset($options['topClazz'])) { $this->topClazz = new core_kernel_classes_Class($options['topClazz']); unset($options['topClazz']); } $returnValue = parent::__construct([], $options); } /** * get the class * * @access public * @author Bertrand Chevrier, * @return core_kernel_classes_Class */ public function getClazz() { $returnValue = null; $returnValue = $this->clazz; return $returnValue; } /** * get the resource * * @access public * @author Bertrand Chevrier, * @return core_kernel_classes_Resource */ public function getInstance() { $returnValue = null; $returnValue = $this->instance; return $returnValue; } /** * get the current top level class (the defined or the default) * * @access public * @author Bertrand Chevrier, * @return core_kernel_classes_Class */ public function getTopClazz() { $returnValue = null; if (!is_null($this->topClazz)) { $returnValue = $this->topClazz; } else { $returnValue = new core_kernel_classes_Class(self::DEFAULT_TOP_CLASS); } return $returnValue; } } /* end of abstract class tao_actions_form_Generis */