GcDevelopment\Controller\DocumentTypeController::importTabAction PHP Method

importTabAction() public method

Add tab in session
public importTabAction ( ) : Zend\View\Model\JsonModel
return Zend\View\Model\JsonModel
    public function importTabAction()
    {
        if (!$this->getRequest()->isPost()) {
            return $this->returnJson(array('success' => false, 'message' => 'Error'));
        }
        $tabId = $this->getRequest()->getPost()->get('tab_id');
        $tabModel = Tab\Model::fromId($tabId);
        $propertiesList = $tabModel->getProperties();
        $properties = array();
        foreach ($propertiesList as $property) {
            $properties[] = array('name' => $property->getName(), 'identifier' => $property->getIdentifier(), 'description' => $property->getDescription(), 'datatype' => $property->getDatatypeId(), 'isRequired' => $property->isRequired());
        }
        $tab = array('name' => $tabModel->getName(), 'description' => $tabModel->getDescription(), 'properties' => $properties);
        return $this->returnJson(array('success' => true, 'tab' => $tab));
    }