本文整理汇总了PHP中Yum::resolveTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP Yum::resolveTableName方法的具体用法?PHP Yum::resolveTableName怎么用?PHP Yum::resolveTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Yum
的用法示例。
在下文中一共展示了Yum::resolveTableName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tableName
public function tableName() {
if (isset(Yum::module()->textSettingsTable))
$this->_tableName = Yum::module()->textSettingsTable;
elseif (isset(Yii::app()->modules['user']['textSettingsTable']))
$this->_tableName = Yii::app()->modules['user']['textSettingsTable'];
else
$this->_tableName = '{{yumtextsettings}}'; // fallback if nothing is set
return Yum::resolveTableName($this->_tableName, $this->getDbConnection());
}
示例2: tableName
public function tableName()
{
if (isset(Yum::module('role')->roleTable)) {
$this->_tableName = Yum::module('role')->roleTable;
} else {
$this->_tableName = '{{role}}';
}
// fallback if nothing is set
return Yum::resolveTableName($this->_tableName, $this->getDbConnection());
}
示例3: tableName
public function tableName()
{
if (isset(Yum::module('membership')->paymentTable)) {
$this->_tableName = Yum::module('membership')->paymentTable;
} else {
$this->_tableName = '{{payment}}';
}
// fallback if nothing is set
return Yum::resolveTableName($this->_tableName, $this->getDbConnection());
}
示例4: tableName
/**
* Returns resolved table name (incl. table prefix when it is set in db configuration)
* Following algorithm of searching valid table name is implemented:
* - try to find out table name stored in currently used module
* - if not found try to get table name from UserModule configuration
* - if not found user default {{profile_field}} table name
* @return string
*/
public function tableName()
{
if (isset(Yum::module('profile')->profileFieldsTable)) {
$this->_tableName = Yum::module('profile')->profileFieldsTable;
} elseif (isset(Yii::app()->modules['user']['profileFieldsTable'])) {
$this->_tableName = Yii::app()->modules['user']['profileFieldsTable'];
} else {
$this->_tableName = '{{profile_field}}';
}
// fallback if nothing is set
return Yum::resolveTableName($this->_tableName, $this->getDbConnection());
}
示例5: tableName
public function tableName()
{
if (isset(Yum::module()->userUsergroupTable)) {
$this->_tableName = Yum::module()->userUsergroupTable;
} elseif (isset(Yii::app()->modules['user']['userUsergroupTable'])) {
$this->_tableName = Yii::app()->modules['user']['userUsergroupTable'];
} else {
$this->_tableName = '{{user_has_usergroup}}';
}
// fallback if nothing is set
return Yum::resolveTableName($this->_tableName, $this->getDbConnection());
}
示例6: actionInstall
//.........这里部分代码省略.........
$db->createCommand($sql)->execute();
if (isset($_POST['installMembership'])) {
$sql = "INSERT INTO `{$paymentTable}` (`title`) VALUES ('Prepayment'), ('Paypal')";
$db->createCommand($sql)->execute();
}
if (isset($_POST['installRole']) && isset($_POST['installPermission'])) {
$sql = "INSERT INTO `" . $actionTable . "` (`title`) VALUES "
."('message_write'),"
."('message_receive'),"
."('user_create'),"
."('user_update'),"
."('user_remove'),"
."('user_admin')";
$db->createCommand($sql)->execute();
$sql = "INSERT INTO `{$permissionTable}` (`principal_id`, `subordinate_id`, `type`, `action`, `template`, `comment`) VALUES "
."(2, 0, 'role', 1, 0, 'Users can write messages'),"
."(2, 0, 'role', 2, 0, 'Users can receive messages'),"
."(2, 0, 'role', 3, 0, 'Users are able to view visits of his profile'),"
."(1, 0, 'role', 4, 0, ''),"
."(1, 0, 'role', 5, 0, ''),"
."(1, 0, 'role', 6, 0, ''),"
."(1, 0, 'role', 7, 0, '');";
$db->createCommand($sql)->execute();
$sql = "INSERT INTO `" . $roleTable . "` (`title`,`description`, `price`, `duration`) VALUES "
."('UserManager', 'This users can manage Users', 0, 0),"
."('Demo', 'Users having the demo role', 0, 0),"
."('Business', 'Example Business account', 9.99, 7),"
."('Premium', 'Example Premium account', 19.99, 28) ";
$db->createCommand($sql)->execute();
$sql = "INSERT INTO `" . $userRoleTable . "` (`user_id`, `role_id`) VALUES (2, 3)";
$db->createCommand($sql)->execute();
}
if (isset($_POST['installProfiles'])) {
$sql = "INSERT INTO `" . $privacySettingTable . "` (`user_id`) values (2)";
$db->createCommand($sql)->execute();
$sql = "INSERT INTO `" . $profileTable . "` (`id`, `user_id`, `lastname`, `firstname`, `email`) VALUES "
."(1, 1, 'admin','admin','webmaster@example.com'),"
."(2, 2, 'demo','demo','demo@example.com')";
$db->createCommand($sql)->execute();
$sql = "INSERT INTO `" . $profileFieldTable . "` "
."(`varname`, `title`, `field_type`, `field_size`, `required`, `visible`, `other_validator`) VALUES "
."('email', 'E-Mail', 'VARCHAR', 255, 1, 3, 'CEmailValidator'),"
."('firstname', 'First name', 'VARCHAR', 255, 1, 3, ''),"
."('lastname', 'Last name', 'VARCHAR', 255, 1, 3, ''),"
."('street','Street', 'VARCHAR', 255, 0, 3, ''),"
."('city','City', 'VARCHAR', 255, 0, 3, ''),"
."('about', 'About', 'TEXT', 255, 0, 3, '')";
$db->createCommand($sql)->execute();
}
// Do it
$transaction->commit();
// Victory
$this->render('success', array('modules' => $createdTables));
}
else
{
throw new CException(Yum::t('Database connection is not working'));
}
}
else {
$this->render('start', array(
//FIXME: We should normalize table names either in singular or plural.
'userTable' => Yum::resolveTableName($this->module->userTable, Yii::app()->db),
'privacySettingTable' => Yum::resolveTableName($this->module->privacySettingTable, Yii::app()->db),
'translationTable' => Yum::resolveTableName($this->module->translationTable, Yii::app()->db),
'roleTable' => Yum::resolveTableName($this->module->roleTable, Yii::app()->db),
'membershipTable' => Yum::resolveTableName($this->module->membershipTable, Yii::app()->db),
'paymentTable' => Yum::resolveTableName($this->module->paymentTable, Yii::app()->db),
'messageTable' => Yum::resolveTableName($this->module->messageTable, Yii::app()->db),
'profileTable' => Yum::resolveTableName($this->module->profileTable, Yii::app()->db),
'profileCommentTable' => Yum::resolveTableName($this->module->profileCommentTable, Yii::app()->db),
'profileVisitTable' => Yum::resolveTableName($this->module->profileVisitTable, Yii::app()->db),
'profileFieldTable' => Yum::resolveTableName($this->module->profileFieldTable, Yii::app()->db),
'userRoleTable' => Yum::resolveTableName($this->module->userRoleTable, Yii::app()->db),
'usergroupTable' => Yum::resolveTableName($this->module->usergroupTable, Yii::app()->db),
'usergroupMessagesTable' => Yum::resolveTableName($this->module->usergroupMessagesTable, Yii::app()->db),
'permissionTable' => Yum::resolveTableName($this->module->permissionTable, Yii::app()->db),
'friendshipTable' => Yum::resolveTableName($this->module->friendshipTable, Yii::app()->db),
'actionTable' => Yum::resolveTableName($this->module->actionTable, Yii::app()->db),
));
}
} else {
throw new CException(Yum::t('User management module is not in Debug Mode'));
}
}