for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Qrz_OneDayAdmin_Model_Cron
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
/**
* @return void
* @author Cristian Quiroz <[email protected]>
*/
public function deactivateOneDayAdmins()
$oneDayAdminRoles = $this->getSystemConfig()->getOneDayAdminRoles();
foreach ($oneDayAdminRoles as $oneDayAdminRole) {
$adminRole = $this->getAdminRolesModel()
->load($oneDayAdminRole, 'role_name');
if (!$adminRole->getId()) {
continue;
}
$adminUserIdArray = $adminRole->getRoleUsers();
$adminUserCollection = $this->getAdminUserModel()->getCollection()
->addFieldToFilter('user_id', array('in' => $adminUserIdArray))
->addFieldToFilter('is_active', 1);
foreach ($adminUserCollection as $adminUser) {
$adminUser->setData('is_active', 0)->save();
* @return Mage_Admin_Model_Roles
protected function getAdminRolesModel()
return Mage::getModel('admin/roles');
* @return Mage_Admin_Model_User
protected function getAdminUserModel()
return Mage::getModel('admin/user');
* @return Qrz_OneDayAdmin_Model_SystemConfig
protected function getSystemConfig()
return Mage::getSingleton('qrz_onedayadmin/systemConfig');
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.