当前位置: 首页>>代码示例>>PHP>>正文


PHP ZendT_Lib::convertTableNameToClassName方法代码示例

本文整理汇总了PHP中ZendT_Lib::convertTableNameToClassName方法的典型用法代码示例。如果您正苦于以下问题:PHP ZendT_Lib::convertTableNameToClassName方法的具体用法?PHP ZendT_Lib::convertTableNameToClassName怎么用?PHP ZendT_Lib::convertTableNameToClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZendT_Lib的用法示例。


在下文中一共展示了ZendT_Lib::convertTableNameToClassName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     $moduleName = $this->getRequest()->getModuleName();
     $tableName = $this->getRequest()->getParam('table');
     $objectName = ZendT_Lib::convertTableNameToClassName($tableName);
     var_dump($moduleName, $tableName, $objectName);
     exit;
 }
开发者ID:rtsantos,项目名称:mais,代码行数:8,代码来源:DefaultController.php

示例2: remove

 /**
  * Remove o Controlador Gerado
  * 
  * @param string $pathBase
  * @param array $config 
  */
 public static function remove($pathBase, $config)
 {
     if (!isset($config['table']['modelName'])) {
         $config['table']['modelName'] = $config['table']['name'];
     }
     $table = ucfirst($config['table']['modelName']);
     $module = $config['table']['moduleName'];
     $pathBase = $path . '/application/configs/modules/' . strtolower($module);
     $tableClass = ZendT_Lib::convertTableNameToClassName($table);
     /**
      * Controller 
      */
     @unlink($pathBase . '/controllers/' . $tableClass . 'Controller.php');
 }
开发者ID:rtsantos,项目名称:mais,代码行数:20,代码来源:Controller.php

示例3: getElement

 /**
  * Retorna as configurações do elemento HTML
  *
  * @param string $columnName
  * @return Monitor_Model_LogServerProcess_Element
  */
 public function getElement($columnName)
 {
     $_element = new Monitor_Form_LogServerProcess_Elements();
     $method = 'get' . ZendT_Lib::convertTableNameToClassName($columnName);
     return $_element->{$method}();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:12,代码来源:Table.php

示例4: getElement

 /**
  * Retorna as configurações do elemento HTML
  *
  * @param string $columnName
  * @return Tools_Model_Maillist_Element
  */
 public function getElement($columnName)
 {
     $_element = new Tools_Model_Maillist_Element();
     $method = 'get' . ZendT_Lib::convertTableNameToClassName($columnName);
     return $_element->{$method}();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:12,代码来源:Table.php

示例5: getElement

 /**
  * Retorna as configurações do elemento HTML
  *
  * @param string $columnName
  * @return Profile_Model_ObjectView_Element
  */
 public function getElement($columnName)
 {
     $_element = new Profile_Form_ObjectView_Elements();
     $method = 'get' . ZendT_Lib::convertTableNameToClassName($columnName);
     return $_element->{$method}();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:12,代码来源:Table.php

示例6: create

    /**
     * Cria as classes de Elemento 
     * 
     * @param string $pathBase
     * @param array $config 
     */
    public static function create($pathBase, $config)
    {
        if (!isset($config['table']['modelName'])) {
            $config['table']['modelName'] = $config['table']['name'];
        }
        $modelName = ZendT_Lib::convertTableNameToClassName($config['table']['modelName']);
        if ($config['table']['moduleName'] == '' || $config['table']['moduleName'] == 'Application') {
            $config['table']['moduleName'] = 'Application';
            $path = 'application/forms/Crud';
        } else {
            $path = 'application/modules/' . $config['table']['moduleName'] . '/forms/' . $modelName . '/Crud';
        }
        ZendT_Lib::createDirectory($pathBase, $path);
        $filename = $pathBase . '/' . $path . '/Elements.php';
        $strBody = '';
        foreach ($config['table']['columns'] as $column => $prop) {
            //echo $column . ' :: ' . $prop['object']['type'] . "\n";
            if (strpos($column, '_type') !== false || strpos($column, '_name') !== false) {
                $name = str_replace(array('_type', '_name'), '', $column);
                $_propLob = $config['table']['columns'][$name];
                if ($_propLob['object']['type'] == 'File') {
                    continue;
                }
            }
            $tableColumn = $column;
            $strValidators = '';
            if (is_array($prop['object']['validators'])) {
                foreach ($prop['object']['validators'] as $validator) {
                    $strValidators .= ",'{$validator['name']}'";
                }
            }
            $strValidators = 'array(' . substr($strValidators, 1) . ')';
            if ($prop['object']['type'] == 'Seeker') {
                $strAttrId = '';
                if (isset($prop['object']['seeker']['id'])) {
                    foreach ($prop['object']['seeker']['id'] as $key => $value) {
                        if ($value) {
                            $strAttrId .= ",'{$key}'=>'{$value}'";
                        }
                    }
                }
                $strAttrId = 'array(' . substr($strAttrId, 1) . ')';
                $strAttrSearch = '';
                if ($prop['object']['seeker']['search']) {
                    foreach ($prop['object']['seeker']['search'] as $key => $value) {
                        if ($value) {
                            $strAttrSearch .= ",'{$key}'=>'{$value}'";
                        }
                    }
                    //$strAttrSearch.= ",'id'=>'$tableColumn'";
                    $strAttrSearch = 'array(' . substr($strAttrSearch, 1) . ')';
                }
                $strAttrDisplay = '';
                if ($prop['object']['seeker']['display']) {
                    foreach ($prop['object']['seeker']['display'] as $key => $value) {
                        if ($value) {
                            $strAttrDisplay .= ",'{$key}'=>'{$value}'";
                        }
                    }
                }
                $strAttrDisplay = 'array(' . substr($strAttrDisplay, 1) . ')';
                $namePrepare = '';
                if (substr(strtolower($tableColumn), 0, 3) == 'id_') {
                    $nameSeeker = substr(strtolower($tableColumn), 3);
                    $namePrepare = "\$element->setSuffix('{$nameSeeker}');";
                } elseif (substr(strtolower($tableColumn), 0, 2) == 'id') {
                    $nameSeeker = substr(strtolower($tableColumn), 2);
                    $namePrepare = "\$element->setSuffix('{$nameSeeker}');";
                } elseif (substr(strtolower($tableColumn), strlen($tableColumn) - 3, 3) == '_id') {
                    $nameSeeker = substr(strtolower($tableColumn), 0, strlen($tableColumn) - 3);
                    $namePrepare = "\$element->setPrefix('{$nameSeeker}');";
                } elseif (substr(strtolower($tableColumn), strlen($tableColumn) - 2, 2) == 'id') {
                    $nameSeeker = substr(strtolower($tableColumn), 0, strlen($tableColumn) - 2);
                    $namePrepare = "\$element->setPrefix('{$nameSeeker}');";
                } else {
                    $nameSeeker = $tableColumn;
                    $namePrepare = "\$element->setSuffix('{$nameSeeker}');";
                }
                //
                if (!isset($prop['object']['seeker']['url']['mapperView'])) {
                    $mapperViewAux = explode('/', $prop['object']['seeker']['url']['grid']);
                    $mapperView['module'] = ucfirst($mapperViewAux[1]);
                    $mapperViewAux = explode('-', $mapperViewAux[2]);
                    $mapperView['name'] = '';
                    foreach ($mapperViewAux as $mapperViewName) {
                        $mapperView['name'] .= ucfirst($mapperViewName);
                    }
                    $prop['object']['seeker']['url']['mapperView'] = $mapperView['module'] . '_DataView_' . $mapperView['name'] . '_MapperView';
                }
                $commentElement = 'ZendT_Form_Element_Seeker';
                if ($prop['object']['seeker']['url']['retrieve'] == '') {
                    $prop['object']['seeker']['url']['retrieve'] = $prop['object']['seeker']['url']['retrive'];
                }
                $suffix = '';
//.........这里部分代码省略.........
开发者ID:rtsantos,项目名称:mais,代码行数:101,代码来源:Element.php

示例7: getElement

 /**
  * Retorna as configurações do elemento HTML
  *
  * @param string $columnName
  * @return Wf_Model_WfProcesso_Element
  */
 public function getElement($columnName)
 {
     $_element = new Wf_Model_WfProcesso_Element();
     $method = 'get' . ZendT_Lib::convertTableNameToClassName($columnName);
     return $_element->{$method}();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:12,代码来源:Table.php

示例8: create

    /**
     * Cria as classes de Serviço 
     * 
     * @param string $pathBase
     * @param array $config 
     */
    public static function create($pathBase, $name, $module)
    {
        $modelName = ZendT_Lib::convertTableNameToClassName($name);
        $moduleName = $module;
        if ($moduleName == '' || $moduleName == 'Application') {
            $moduleName = 'Application';
            $path = 'application/reports';
        } else {
            $path = 'application/modules/' . $moduleName . '/reports';
        }
        $ucModuleName = ucfirst($moduleName);
        ZendT_Lib::createDirectory($pathBase, $path);
        $filename = $path . '/' . $modelName . '.php';
        $contentText = <<<EOS
<?php
    /**
     * Classe de relatório {$modelName}
     *
     * @package ZendT
     * @subpackage Report
     */
    class {$ucModuleName}_Report_{$modelName}{
        /**
         * @var ZendT_Report_Abstract
         */
        protected \$_report;
        /**
         * @var ZendT_Db_Mapper
         */
        protected \$_mapper;
        /**
         * Construtor
         */
        public function __construct(\$driver,ZendT_Db_Mapper \$_mapper){
            \$this->_report = ZendT_Report::factory(\$driver);
            \$this->_mapper = \$_mapper;
            
            \$this->_report->setTitle('Título do Relatório');
            \$this->_report->addPage();
            
            \$row = array();
            \$row['column'] = 'column';
            \$this->_addRow(\$row,true);
            \$this->_report->drawLine();
        }
        /**
         *
         * @param array \$row
         * @param bool \$title
         */
        private function _addRow(\$row,\$title=false){
            \$_cell = new ZendT_Report_Cell();
            \$_cell->setValue(\$row['column']);
            \$_cell->setWidth(200);
            \$_cell->setType('String');
            \$_cell->setFontWeight(\$title);
            \$this->_report->addCell(\$_cell);
            
            \$this->_report->printCells();
        }
        /**
         *
         * @return ZendT_Db_Recordset
         */
        private function _getRecodset(){
            \$sql = "SELECT * FROM ".\$this->_mapper->getModel()->getTableName();
            \$stmt = \$this->_mapper->getModel()->getAdapter()->query(\$sql);
            \$columnMappers = new ZendT_Db_Column_Mapper();
            \$columnMappers->add('column', \$this->_mapper->getColumn(true));
            \$rs = new ZendT_Db_Recordset(\$stmt,\$columnMappers,true);
            return \$rs;
        }
        /**
         *
         */
        private function _make(){
            \$recordset = \$this->_getRecodset();
            while(\$row = \$recordset->getRow()){
                \$this->_addRow(\$row,false);
            }
            \$this->_report->drawLine();
        }
        /**
         *
         */
        public function show(\$dest='S'){
            \$this->_make();
            return \$this->_report->output('relatorio',\$dest);
        }
    }
?>
EOS;
        file_put_contents($filename, $contentText);
    }
开发者ID:rtsantos,项目名称:mais,代码行数:100,代码来源:Report.php

示例9: getElement

 /**
  * Retorna as configurações do elemento HTML
  *
  * @param string $columnName
  * @return Log_Model_LogTabela_Element
  */
 public function getElement($columnName)
 {
     $_element = new Log_Form_LogTabela_Elements();
     $method = 'get' . ZendT_Lib::convertTableNameToClassName($columnName);
     return $_element->{$method}();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:12,代码来源:Table.php

示例10: createView

    public static function createView($pathBase, $name, $configTable)
    {
        $modelName = ZendT_Lib::convertTableNameToClassName($configTable['table']['name']);
        $className = ZendT_Lib::convertTableNameToClassName($name);
        if ($configTable['table']['moduleName'] == '' || $configTable['table']['moduleName'] == 'Application') {
            $configTable['table']['moduleName'] = 'Application';
            $path = 'application/models/View';
        } else {
            $path = 'application/modules/' . $configTable['table']['moduleName'] . '/models/' . $modelName . '/View';
        }
        $ucModuleName = ucfirst($configTable['table']['moduleName']);
        ZendT_Lib::createDirectory($pathBase, $path);
        $contentText = <<<EOS
<?php
    /**
    * Classe de visão da tabela {$configTable['table']['name']}
    */
    class {$ucModuleName}_Model_{$modelName}_View_{$className} extends {$ucModuleName}_Model_{$modelName}_Mapper implements ZendT_Db_View
    {
        /**
         * Retorna as configurações padrão da visualização
         *
         * @return array
         */
        protected function _getSettingsDefault(){
           \$profile = array();
           \$profile['order'] = array();
           \$profile['width'] = array();
           \$profile['align'] = array();
           \$profile['hidden'] = array();
           \$profile['remove'] = array();
           \$profile['listOptions'] = array();
           return \$profile;
        }
        /**
         * Carrega as colunas com suas configurações 
         */
        protected function _loadColumns(){
            \$this->_columns = new ZendT_Db_Column_View('{$ucModuleName}_Model_{$modelName}_View_{$className}',\$this->_getSettingsDefault());
        }
        /**
         * Retorna o SQL Base
         */
        protected function _getSqlBase() {
            \$sql = \$this->getModel()->getTableName() . ' {$configTable['table']['name']} ';
            return \$sql;
        }
    }
?>
EOS;
        $filename = $path . '/' . $className . '.php';
        echo $filename;
        file_put_contents($filename, $contentText);
    }
开发者ID:rtsantos,项目名称:mais,代码行数:54,代码来源:MapperView.php

示例11: getElement

 /**
  * Retorna as configurações do elemento HTML
  *
  * @param string $columnName
  * @return Ca_Model_RegraContrato_Element
  */
 public function getElement($columnName)
 {
     $_element = new Ca_Form_RegraContrato_Elements();
     $method = 'get' . ZendT_Lib::convertTableNameToClassName($columnName);
     return $_element->{$method}();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:12,代码来源:Table.php

示例12: create

    /**
     * Cria as classes de Mappero 
     * 
     * @param string $pathBase
     * @param array $config 
     */
    public static function create($pathBase, $config)
    {
        if (!isset($config['table']['modelName'])) {
            $config['table']['modelName'] = $config['table']['name'];
        }
        $modelName = ZendT_Lib::convertTableNameToClassName($config['table']['modelName']);
        if ($config['table']['moduleName'] == '' || $config['table']['moduleName'] == 'Application') {
            $config['table']['moduleName'] = 'Application';
            $path = 'application/models/Crud';
        } else {
            $path = 'application/modules/' . $config['table']['moduleName'] . '/models/' . $modelName . '/Crud';
        }
        $ucModuleName = ucfirst($config['table']['moduleName']);
        ZendT_Lib::createDirectory($pathBase, $path);
        $tabs = $config['table']['tabs'];
        if (!$tabs) {
            $tabs = array();
        }
        $tabs = var_export($tabs, true);
        $strReferenceMap = '';
        foreach ($config['table']['referenceMaps'] as $prop) {
            $referenceName = ZendT_Lib::convertTableNameToClassName($prop['columnName']);
            $strReferenceMap .= ",\n                '" . $prop['columnName'] . "' => array(\n                    'mapper' => '" . str_replace('_Model_', '_DataView_', $prop['objectNameReference']) . "_MapperView',\n                    'column' => '" . $prop['columnReference'] . "'\n                )";
        }
        $strReferenceMap = substr($strReferenceMap, 1);
        $strBody = '';
        $strRequired = '';
        foreach ($config['table']['columns'] as $column => $prop) {
            //print_r($prop['object']['filter']);
            $strFilter = 'array(';
            if (isset($prop['object']['filter'])) {
                foreach ($prop['object']['filter'] as $key => $value) {
                    if (is_array($value)) {
                        $strFilter .= "'{$key}' => array('" . implode("','", $value) . "'), ";
                    } else {
                        $strFilter .= "'{$value}', ";
                    }
                }
            }
            $strFilter .= ')';
            $set = "\$this->_data['{$column}'] = \$value;";
            if (in_array($prop['object']['type'], array('Date', 'DateTime', 'Time'))) {
                $set = "\$this->_data['{$column}'] = new ZendT_Type_Date(\$value,'{$prop['object']['type']}');";
                $set .= "\n         if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                    ";
            } elseif (in_array($prop['object']['type'], array('Numeric', 'Integer')) || in_array($prop['type'], array('Numeric', 'Integer'))) {
                #echo $column . "\n";
                $numDecimal = $prop['object']['numeric']['numDecimal'];
                if (strtolower($prop['object']['type']) == strtolower('Seeker') || in_array(strtolower($column), $config['table']['primary'])) {
                    $numDecimal = 'null';
                } else {
                    if (!$numDecimal) {
                        $numDecimal = 0;
                    }
                }
                $set = "\$this->_data['{$column}'] = new ZendT_Type_Number(\$value,array('numDecimal'=>{$numDecimal}));";
                $set .= "\n         if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                    ";
            } else {
                if (in_array($prop['type'], array('StringLong'))) {
                    $set = "\n         \$this->_data['{$column}'] = new ZendT_Type_Clob(\$value);";
                    $set .= "\n         if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                ";
                } else {
                    if (in_array($prop['object']['type'], array('File'))) {
                        $set = "\$this->_data['{$column}'] = new ZendT_Type_Blob(\$value);\n         if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                ";
                    } else {
                        if ($prop['object']['mask'] != NULL) {
                            $set = "\$this->_data['{$column}'] = new ZendT_Type_String(\$value,array('mask'=>" . var_export($prop['object']['mask'], true) . "\n                                                                   ,'charMask'=>" . var_export($prop['object']['charMask'], true) . "\n                                                                   ,'filterDb'=>" . var_export($prop['object']['filterDb'], true) . "\n                                                                   ,'filter'=>" . $strFilter . "));\n        if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                ";
                        } else {
                            if (in_array($prop['object']['type'], array('Text'))) {
                                $set = "\$this->_data['{$column}'] = new ZendT_Type_String(\$value,array('mask'=>''\n                                                                   ,'charMask'=>''\n                                                                   ,'filterDb'=>" . var_export($prop['object']['filterDb'], true) . "\n                                                                   ,'filter'=>" . $strFilter . "));\n        if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                ";
                            } else {
                                if (in_array($prop['object']['type'], array('Select'))) {
                                    $varListOptions = array();
                                    foreach ($prop['object']['listOptions'] as $key => $value) {
                                        if ((string) $key != '') {
                                            $varListOptions[] = "'" . $key . "'=>'" . $value . "'";
                                        }
                                    }
                                    $set = "\n        \$options['listOptions']=array(" . implode(',', $varListOptions) . ");\n        \$this->_data['{$column}'] = new ZendT_Type_String(\$value,\$options);\n        if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                ";
                                } else {
                                    $set = "\$this->_data['{$column}'] = new ZendT_Type_String(\$value);\n        if (\$options['db'])\n            \$this->_data['{$column}']->setValueFromDb(\$value);\n                ";
                                }
                            }
                        }
                    }
                }
            }
            $strValidators = '';
            if ($prop['object']['required']) {
                $strRequired .= ",'{$column}'";
                $strValidators .= "\n         if (\$options['required'])\n            \$this->isRequired(\$value,'{$column}');\n                    ";
            }
            if (is_array($prop['object']['validators'])) {
                foreach ($prop['object']['validators'] as $validator) {
                    $strValidators .= "\n            \$valid = new " . $validator['name'] . "(" . str_replace("\n", " ", var_export($validator['param'], true)) . " );\n            \$valueValid = \$this->_data['{$column}']->getValueToDb();\n            if (\$valueValid && !\$valid->isValid(\$valueValid)){\n                throw new ZendT_Exception_Business(implode(\"\\n\",\$valid->getMessages()));\n            }\n                    ";
//.........这里部分代码省略.........
开发者ID:rtsantos,项目名称:mais,代码行数:101,代码来源:Mapper.php

示例13: developerTable

    /**
     * Cria o modelo do desenvolvedor que pode manipular os dados
     * 
     * @param string $pathBase
     * @param array $config 
     */
    public static function developerTable($pathBase, $config)
    {
        if (!isset($config['table']['modelName'])) {
            $config['table']['modelName'] = $config['table']['name'];
        }
        $modelName = ZendT_Lib::convertTableNameToClassName($config['table']['modelName']);
        if ($config['table']['moduleName'] == '' || $config['table']['moduleName'] == 'Application') {
            $config['table']['moduleName'] = 'Application';
            $path = 'application/models';
        } else {
            $path = 'application/modules/' . $config['table']['moduleName'] . '/models/' . $modelName;
        }
        ZendT_Lib::createDirectory($pathBase, $path);
        $filename = $pathBase . '/' . $path . '/Table.php';
        $ucModuleName = ucfirst($config['table']['moduleName']);
        $contentText = <<<EOS
<?php
    /**
     * Classe de mapeamento da tabela {$config['table']['name']}
     */
    class {$ucModuleName}_Model_{$modelName}_Table extends {$ucModuleName}_Model_{$modelName}_Crud_Table{

    }
?>
EOS;
        if (!file_exists($filename)) {
            file_put_contents($filename, $contentText);
        }
    }
开发者ID:rtsantos,项目名称:mais,代码行数:35,代码来源:Table.php

示例14: getElement

 /**
  * Retorna as configurações do elemento HTML
  *
  * @param string $columnName
  * @return Financeiro_Model_Banco_Element
  */
 public function getElement($columnName)
 {
     $_element = new Financeiro_Form_Banco_Elements();
     $method = 'get' . ZendT_Lib::convertTableNameToClassName($columnName);
     return $_element->{$method}();
 }
开发者ID:rtsantos,项目名称:mais,代码行数:12,代码来源:Table.php

示例15: factory

 public function factory($table, $module)
 {
     $this->_loadProfile(self::NO_PROFILE_THROW_EXCEPTION);
     $path = $this->_loadedProfile->getAttribute('projectDirectory');
     $dirModules = $path . '/application/configs/modules';
     if (!is_dir($dirModules)) {
         mkdir($dirModules);
     }
     $dirModule = $dirModules . '/' . $module;
     if (!is_dir($dirModule)) {
         mkdir($dirModule);
     }
     $fileName = $dirModule . '/' . $table . '.php';
     if (!file_exists($fileName)) {
         throw new Zend_Tool_Project_Provider_Exception('Para executar essa ação é necessário criar o arquivo ' . $fileName);
     }
     $config = (require $fileName);
     $path .= '/application/modules/' . strtolower($module);
     /**
      * Gerando o DataView 
      */
     if (!isset($config['table']['modelName'])) {
         $config['table']['modelName'] = $config['table']['name'];
     }
     $modelName = ZendT_Lib::convertTableNameToClassName($config['table']['modelName']);
     /**
      * 
      */
     if (file_exists($path . '/models/' . $modelName . '/MapperView.php')) {
         ZendT_Lib::createDirectory($path, '/data-views/' . $modelName . '/Crud');
         copy($path . '/models/' . $modelName . '/Crud/MapperView.php', $path . '/data-views/' . $modelName . '/Crud/MapperView.php');
         unlink($path . '/models/' . $modelName . '/Crud/MapperView.php');
         $content = file_get_contents($path . '/data-views/' . $modelName . '/Crud/MapperView.php');
         $content = str_replace(ucfirst($module) . '_Model_' . $modelName . '_Crud_MapperView', ucfirst($module) . '_DataView_' . $modelName . '_Crud_MapperView', $content);
         file_put_contents($path . '/data-views/' . $modelName . '/Crud/MapperView.php', $content);
         copy($path . '/models/' . $modelName . '/MapperView.php', $path . '/data-views/' . $modelName . '/MapperView.php');
         unlink($path . '/models/' . $modelName . '/MapperView.php');
         $content = file_get_contents($path . '/data-views/' . $modelName . '/MapperView.php');
         $content = str_replace(ucfirst($module) . '_Model_' . $modelName . '_MapperView', ucfirst($module) . '_DataView_' . $modelName . '_MapperView', $content);
         $content = str_replace(ucfirst($module) . '_Model_' . $modelName . '_Crud_MapperView', ucfirst($module) . '_DataView_' . $modelName . '_Crud_MapperView', $content);
         file_put_contents($path . '/data-views/' . $modelName . '/MapperView.php', $content);
         $content = file_get_contents($path . '/controllers/' . $modelName . 'Controller.php');
         $content = str_replace(ucfirst($module) . '_Model_' . $modelName . '_MapperView', ucfirst($module) . '_DataView_' . $modelName . '_MapperView', $content);
         file_put_contents($path . '/controllers/' . $modelName . 'Controller.php', $content);
         $this->_print('Objeto MapperView fatorado com sucesso!');
     } else {
         $this->_print('Objeto MapperView já fatorado');
     }
     /**
      * 
      */
     if (file_exists($path . '/models/' . $modelName . '/Element.php')) {
         copy($path . '/models/' . $modelName . '/Crud/Element.php', $path . '/forms/' . $modelName . '/Crud/Elements.php');
         unlink($path . '/models/' . $modelName . '/Crud/Element.php');
         $content = file_get_contents($path . '/forms/' . $modelName . '/Crud/Elements.php');
         $content = str_replace(ucfirst($module) . '_Model_' . $modelName . '_Crud_Element', ucfirst($module) . '_Form_' . $modelName . '_Crud_Elements', $content);
         file_put_contents($path . '/forms/' . $modelName . '/Crud/Elements.php', $content);
         copy($path . '/models/' . $modelName . '/Element.php', $path . '/forms/' . $modelName . '/Elements.php');
         unlink($path . '/models/' . $modelName . '/Element.php');
         $content = file_get_contents($path . '/forms/' . $modelName . '/Elements.php');
         $content = str_replace(ucfirst($module) . '_Model_' . $modelName . '_Element', ucfirst($module) . '_Form_' . $modelName . '_Elements', $content);
         $content = str_replace(ucfirst($module) . '_Model_' . $modelName . '_Crud_Element', ucfirst($module) . '_Form_' . $modelName . '_Crud_Elements', $content);
         file_put_contents($path . '/forms/' . $modelName . '/Elements.php', $content);
         $this->_print('Objeto Element fatorado com sucesso!');
     } else {
         $this->_print('Objeto Element já fatorado');
     }
     ZendT_Lib::replaceFiles($path, ucfirst($module) . '_Model_' . $modelName . '_MapperView', ucfirst($module) . '_DataView_' . $modelName . '_MapperView');
     ZendT_Lib::replaceFiles($path, ucfirst($module) . '_Model_' . $modelName . '_Element', ucfirst($module) . '_Form_' . $modelName . '_Elements');
     $path = $this->_loadedProfile->getAttribute('projectDirectory');
     $this->_print(' Criando Tables ');
     ZendT_Tool_Crud_Table::create($path, $config);
     $this->_print(' Criando Mappers ');
     ZendT_Tool_Crud_Mapper::create($path, $config);
     $this->_print(' Criando MapperView ');
     ZendT_Tool_Crud_MapperView::create($path, $config);
     $this->_print(' Criando Elements ');
     ZendT_Tool_Crud_Element::create($path, $config);
     $this->_print(' Criando Form ');
     ZendT_Tool_Crud_Form::create($path, $config);
     $this->_print(' Criando Bootstrap ');
     ZendT_Tool_Crud_Bootstrap::create($path, $config, 1);
     $this->_print('Finalizado Factory ' . $table);
 }
开发者ID:rtsantos,项目名称:mais,代码行数:84,代码来源:CrudTProvider.php


注:本文中的ZendT_Lib::convertTableNameToClassName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。