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


PHP KInflector::tableize方法代码示例

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


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

示例1: getTable

 /**
  * Get the identifier for the table with the same name
  *
  * @return	KIdentifierInterface
  */
 public function getTable()
 {
     if (!$this->_table) {
         $identifier = clone $this->_identifier;
         $identifier->name = KInflector::tableize($identifier->name);
         $identifier->path = array('database', 'table');
         $this->_table = KFactory::get($identifier);
     }
     return $this->_table;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:15,代码来源:table.php

示例2: __construct

 /**
  * Constructor
  *
  * @param	array An optional associative array of configuration settings.
  */
 public function __construct(array $options = array())
 {
     //set the model dbo
     $this->_db = isset($options['dbo']) ? $options['dbo'] : KFactory::get('lib.joomla.database');
     parent::__construct($options);
     // set the table associated to the model
     if (isset($options['table'])) {
         $this->_table = $options['table'];
     } else {
         $table = KInflector::tableize($this->getClassName('suffix'));
         $component = $this->getClassName('prefix');
         $application = KFactory::get('lib.joomla.application')->getName();
         $this->_table = $application . '::com.' . $component . '.table.' . $table;
     }
 }
开发者ID:janssit,项目名称:www.reliancelaw.be,代码行数:20,代码来源:table.php

示例3: setTable

 /**
  * Method to set a table object attached to the rowset
  *
  * @param	mixed	An object that implements KObjectServiceable, KServiceIdentifier object
  * 					or valid identifier string
  * @throws	KDatabaseRowException	If the identifier is not a table identifier
  * @return	KDatabaseRowsetAbstract
  */
 public function setTable($table)
 {
     if (!$table instanceof KDatabaseTableAbstract) {
         if (is_string($table) && strpos($table, '.') === false) {
             $identifier = clone $this->getIdentifier();
             $identifier->path = array('database', 'table');
             $identifier->name = KInflector::tableize($table);
         } else {
             $identifier = $this->getIdentifier($table);
         }
         if ($identifier->path[1] != 'table') {
             throw new KDatabaseRowsetException('Identifier: ' . $identifier . ' is not a table identifier');
         }
         $table = $identifier;
     }
     $this->_table = $table;
     return $this;
 }
开发者ID:janssit,项目名称:www.ondernemenddiest.be,代码行数:26,代码来源:table.php

示例4: setDocument

 /**
  * Method to set a document object attached to the model
  *
  * @param   mixed   An object that implements KObject, an object that
  *                  implements KIdentifierInterface or valid identifier string
  * @throws  KDatabaseRowsetException    If the identifier is not a document identifier
  * @return  KModelDocument
  */
 public function setDocument($document)
 {
     if (!$document instanceof SDatabaseDocumentAbstract) {
         if (is_string($document) && strpos($document, '.') === false) {
             $identifier = clone $this->getIdentifier();
             $identifier->path = array('database', 'document');
             $identifier->name = KInflector::tableize($document);
         } else {
             $identifier = $this->getIdentifier($document);
         }
         if ($identifier->path[1] != 'document') {
             throw new KDatabaseRowsetException('Identifier: ' . $identifier . ' is not a document identifier');
         }
         $document = $identifier;
     }
     $this->_document = $document;
     return $this;
 }
开发者ID:raeldc,项目名称:nooku-mongodb,代码行数:26,代码来源:document.php

示例5: getTable

 /**
  * Get the identifier for the table with the same name
  * 
  * Function catches KDatabaseTableExceptions that are thrown for tables that don't exist.
  *
  * @return  KIdentifierInterface
  */
 public function getTable()
 {
     if (!isset($this->_table)) {
         try {
             $identifier = clone $this->_identifier;
             $identifier->name = KInflector::tableize($identifier->name);
             $identifier->path = array('database', 'table');
             $this->_table = KFactory::get($identifier);
         } catch (KDatabaseTableException $e) {
             //Set the table object to false
             $this->_table = false;
         }
     }
     return $this->_table;
 }
开发者ID:ravenlife,项目名称:Ninja-Framework,代码行数:22,代码来源:table.php


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