本文整理汇总了PHP中Mage_Core_Model_Abstract::getUserId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_Abstract::getUserId方法的具体用法?PHP Mage_Core_Model_Abstract::getUserId怎么用?PHP Mage_Core_Model_Abstract::getUserId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Core_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Core_Model_Abstract::getUserId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: roleUserExists
/**
* Check if role user exists
*
* @param Mage_Core_Model_Abstract $user
* @return array|false
*/
public function roleUserExists(Mage_Core_Model_Abstract $user)
{
if ($user->getUserId() > 0) {
$roleTable = $this->getTable('admin/role');
$dbh = $this->_getReadAdapter();
$binds = array('parent_id' => $user->getRoleId(), 'user_id' => $user->getUserId());
$select = $dbh->select()->from($roleTable)->where('parent_id = :parent_id')->where('user_id = :user_id');
return $dbh->fetchCol($select, $binds);
} else {
return array();
}
}
示例2: roleUserExists
/**
* Retrieve roles which exists for user
*
* @param Mage_Core_Model_Abstract $user
* @return array
*/
public function roleUserExists(Mage_Core_Model_Abstract $user)
{
$result = array();
if ($user->getUserId() > 0) {
$adapter = $this->_getReadAdapter();
$select = $adapter->select()->from($this->getTable('api/role'))->where('parent_id = ?', $user->getRoleId())->where('user_id = ?', $user->getUserId());
$result = $adapter->fetchCol($select);
}
return $result;
}
示例3: roleUserExists
public function roleUserExists(Mage_Core_Model_Abstract $user)
{
if ($user->getUserId() > 0) {
$roleTable = $this->getTable('api/role');
$dbh = $this->_getReadAdapter();
$select = $dbh->select()->from($roleTable)->where("parent_id = {$user->getRoleId()} AND user_id = {$user->getUserId()}");
return $dbh->fetchCol($select);
} else {
return array();
}
}
示例4: hasAssigned2Role
public function hasAssigned2Role(Mage_Core_Model_Abstract $user)
{
if ($user->getId() > 0) {
$dbh = $this->_getReadAdapter();
$select = $dbh->select();
$select->from($this->getTable('admin/role'))->where("parent_id > 0 AND user_id = {$user->getUserId()}");
return $dbh->fetchAll($select);
} else {
return null;
}
}