本文整理汇总了PHP中lmb_camel_case函数的典型用法代码示例。如果您正苦于以下问题:PHP lmb_camel_case函数的具体用法?PHP lmb_camel_case怎么用?PHP lmb_camel_case使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了lmb_camel_case函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _addParamsToDataset
protected function _addParamsToDataset($dataset, $params)
{
foreach ($params as $param => $value) {
$method = lmb_camel_case('set_' . $param, false);
$dataset->{$method}($value);
}
}
示例2: __construct
/**
* @param lmbProjectConstructor $project
* @param lmbDbInfo $database_info
* @param lmbDbTableInfo $table
* @param string $model_name
*/
function __construct($project, $database_info, $table, $model_name = null, $templates_dir = null)
{
parent::__construct($project, $database_info, $table, $templates_dir);
if (is_null($model_name)) {
$model_name = lmb_camel_case($table->getName());
}
$this->_model_name = $model_name;
}
示例3: testChangeOutput
function testChangeOutput()
{
$cont = $this->_getContainer();
$cont->setOutputType('gif');
$class_name = 'lmb' . lmb_camel_case($this->driver) . 'OutputImageFilter';
$filter = new $class_name(array('type' => 'jpeg'));
$filter->apply($cont);
$this->assertEqual($cont->getOutputType(), 'jpeg');
}
示例4: testCamelCaseDontUcfirst
function testCamelCaseDontUcfirst()
{
$this->assertEqual(lmb_camel_case('foo', false), 'foo');
$this->assertEqual(lmb_camel_case('foo_bar', false), 'fooBar');
$this->assertEqual(lmb_camel_case('foo168_bar', false), 'foo168Bar');
$this->assertEqual(lmb_camel_case('foo_bar_hey_wow', false), 'fooBarHeyWow');
$this->assertEqual(lmb_camel_case('_foo_bar', false), '_fooBar');
$this->assertEqual(lmb_camel_case('_foo_bar_', false), '_fooBar_');
$this->assertEqual(lmb_camel_case('___foo___bar', false), '___foo_Bar');
$this->assertEqual(lmb_camel_case('___foo___bar_hey', false), '___foo_BarHey');
}
示例5: _fillHints
function _fillHints()
{
$result = array();
foreach ($this->_hints as $hint) {
$method = '_get' . lmb_camel_case($hint) . 'Hint';
$wrapped_hint = $this->_wrapHint($hint);
if (!strpos($this->_template_sql, $wrapped_hint)) {
throw new lmbException('Hint ' . $wrapped_hint . ' is not found in template sql "' . $this->_template_sql . '"');
}
$result[$wrapped_hint] = $this->{$method}();
}
$hints_in_template_sql = $this->_findAndWrapHintsFromTemplateSql();
foreach ($hints_in_template_sql as $hint) {
if (!isset($result[$hint])) {
$result[$hint] = "";
}
}
return $result;
}
示例6: _createDataSet
function _createDataSet()
{
if (!$this->class_path) {
throw new lmbException('Class path is not defined!');
}
$class_path = new lmbClassPath($this->class_path);
$class_path->import();
$class_name = $class_path->getClassName();
if (is_null($this->record_id) && is_null($this->record_ids)) {
if (!$this->find) {
return lmbActiveRecord::find($class_name);
} else {
$method = 'find' . lmb_camel_case($this->find);
$callback = array($class_name, $method);
if (!is_callable($callback)) {
throw new lmbException('Active record of class "' . $class_name . '" does not support method "' . $method . '"');
}
return call_user_func_array($callback, $this->find_params);
}
}
if ($this->record_id) {
try {
if ($this->find) {
$method = 'find' . lmb_camel_case($this->find);
$callback = array($class_name, $method);
if (!is_callable($callback)) {
throw new lmbException('Active record of class "' . $class_name . '" does not support method "' . $method . '"');
}
$record = call_user_func_array($callback, array($this->record_id));
} else {
$record = lmbActiveRecord::findById($class_name, $this->record_id);
}
} catch (lmbARNotFoundException $e) {
$record = array();
}
return $this->_singleItemCollection($record);
} elseif ($this->record_ids) {
return lmbActiveRecord::findByIds($class_name, $this->record_ids);
}
return new lmbCollection();
}
示例7: _mapPropertyToSetMethod
protected function _mapPropertyToSetMethod($property)
{
$method = 'set' . lmb_camel_case($property);
if ($method !== 'set' && method_exists($this, $method)) {
return $method;
}
}
示例8: _mapPropertyToSetMethod
protected function _mapPropertyToSetMethod($property)
{
$this->_ensureSignatures();
$method = 'set' . lmb_camel_case($property);
if (isset($this->_tools_signatures[$method])) {
return $method;
}
}
示例9: actionToMethod
static function actionToMethod($name)
{
return lmb_camel_case(self::sanitizeName($name));
}
示例10: getLmbRule
static function getLmbRule($underscored_name)
{
if (isset(self::$rules_shortcuts[$underscored_name])) {
$underscored_name = self::$rules_shortcuts[$underscored_name];
}
return 'lmb' . lmb_camel_case($underscored_name) . 'Rule.class.php';
}
示例11: _processDispatchResult
function _processDispatchResult(&$dispatched)
{
if (isset($dispatched['controller'])) {
$dispatched['controller'] = lmb_camel_case($dispatched['controller']);
}
}
示例12: testCamelCaseWithNumbers
function testCamelCaseWithNumbers()
{
$this->assertEqual(lmb_camel_case('foo_0'), 'Foo_0');
$this->assertEqual(lmb_camel_case('foo_1_bar'), 'Foo_1Bar');
}
示例13: _mapTableNameToClass
protected function _mapTableNameToClass($table_name)
{
return lmb_camel_case($table_name);
}
示例14: mapPropertyToAddToMethod
/**
* Maps property name to "addTo" form, e.g. "property_name" => "addToPropertyName"
* @param string
* @return string
*/
function mapPropertyToAddToMethod($property)
{
return 'addTo' . lmb_camel_case($property);
}
示例15: _formRelationManyToMany
function _formRelationManyToMany($local_table, $relation_table)
{
$local_relation_column_name = $this->_aggrements_resolver->makeRelationColumnNameFromTable($local_table->getName());
$related_tables = $this->_aggrements_resolver->getManyToManyRelatedTablesFromRelationTable($relation_table);
$foreign_table = $related_tables[0] == $local_table->getName() ? $this->_db_info->getTable($related_tables[1]) : $this->_db_info->getTable($related_tables[0]);
return array(lmb_plural($foreign_table->getName()) => array('field' => $local_relation_column_name, 'foreign_field' => $this->_aggrements_resolver->makeRelationColumnNameFromTable($foreign_table), 'table' => $relation_table->getName(), 'class' => lmb_camel_case($foreign_table->getName())));
}