function getForm() { if (!isset($this->form)) { // Look for the entry first if ($this->form = DynamicFormEntry::lookup(array('object_type' => 'C'))) { return $this->form; } elseif (!($this->form = DynamicForm::lookup(array('type' => 'C')))) { $this->__loadDefaultForm(); return $this->getForm(); } // Create an entry to be saved later $this->form = $this->form->instanciate(); $this->form->object_type = 'C'; } return $this->form; }