web/lib/Zend/Tool/Project/Context/Zf/ModelFile.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Tool
    16  * @package    Zend_Tool
    17  * @subpackage Framework
    17  * @subpackage Framework
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    20  * @version    $Id: ModelFile.php 20096 2010-01-06 02:05:09Z bkarwin $
    20  * @version    $Id: ModelFile.php 24593 2012-01-05 20:35:02Z matthew $
    21  */
    21  */
       
    22 
       
    23 /**
       
    24  * Zend_Tool_Project_Context_Zf_AbstractClassFile
       
    25  */
       
    26 require_once 'Zend/Tool/Project/Context/Zf/AbstractClassFile.php';
    22 
    27 
    23 /**
    28 /**
    24  * This class is the front most class for utilizing Zend_Tool_Project
    29  * This class is the front most class for utilizing Zend_Tool_Project
    25  *
    30  *
    26  * A profile is a hierarchical set of resources that keep track of
    31  * A profile is a hierarchical set of resources that keep track of
    27  * items within a specific project.
    32  * items within a specific project.
    28  *
    33  *
    29  * @category   Zend
    34  * @category   Zend
    30  * @package    Zend_Tool
    35  * @package    Zend_Tool
    31  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    36  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    32  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    37  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    33  */
    38  */
    34 class Zend_Tool_Project_Context_Zf_ModelFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile
    39 class Zend_Tool_Project_Context_Zf_ModelFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile
    35 {
    40 {
    36 
    41 
    37     /**
    42     /**
    38      * @var string
    43      * @var string
    39      */
    44      */
    40     protected $_modelName = 'Base';
    45     protected $_modelName = 'Base';
    41     
    46 
    42     /**
    47     /**
    43      * @var string
    48      * @var string
    44      */
    49      */
    45     protected $_filesystemName = 'modelName';
    50     protected $_filesystemName = 'modelName';
    46     
    51 
    47     /**
    52     /**
    48      * init()
    53      * init()
    49      *
    54      *
    50      */
    55      */
    51     public function init()
    56     public function init()
    64     {
    69     {
    65         return array(
    70         return array(
    66             'modelName' => $this->getModelName()
    71             'modelName' => $this->getModelName()
    67             );
    72             );
    68     }
    73     }
    69     
    74 
    70     /**
    75     /**
    71      * getName()
    76      * getName()
    72      *
    77      *
    73      * @return string
    78      * @return string
    74      */
    79      */
    79 
    84 
    80     public function getModelName()
    85     public function getModelName()
    81     {
    86     {
    82         return $this->_modelName;
    87         return $this->_modelName;
    83     }
    88     }
    84     
    89 
    85     public function getContents()
    90     public function getContents()
    86     {
    91     {
    87         
    92 
    88         $className = $this->getFullClassName($this->_modelName, 'Model');
    93         $className = $this->getFullClassName($this->_modelName, 'Model');
    89         
    94 
    90         $codeGenFile = new Zend_CodeGenerator_Php_File(array(
    95         $codeGenFile = new Zend_CodeGenerator_Php_File(array(
    91             'fileName' => $this->getPath(),
    96             'fileName' => $this->getPath(),
    92             'classes' => array(
    97             'classes' => array(
    93                 new Zend_CodeGenerator_Php_Class(array(
    98                 new Zend_CodeGenerator_Php_Class(array(
    94                     'name' => $className,
    99                     'name' => $className,
    95                     ))
   100                     ))
    96                 )
   101                 )
    97             ));
   102             ));
    98         return $codeGenFile->generate();
   103         return $codeGenFile->generate();
    99     }
   104     }
   100     
   105 
   101     
   106 
   102 }
   107 }