本文整理汇总了PHP中Axis::single方法的典型用法代码示例。如果您正苦于以下问题:PHP Axis::single方法的具体用法?PHP Axis::single怎么用?PHP Axis::single使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axis
的用法示例。
在下文中一共展示了Axis::single方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: down
public function down()
{
$installer = $this->getInstaller();
$installer->run("\n DROP TABLE IF EXISTS `{$installer->getTable('sitemap_file')}`;\n DROP TABLE IF EXISTS `{$installer->getTable('sitemap_file_engine')}`;\n ");
$this->getConfigBuilder()->remove('sitemap');
Axis::single('core/page')->remove('sitemap/*/*')->remove('sitemap/index/*')->remove('sitemap/index/index')->remove('sitemap/index/get-all-categories')->remove('sitemap/index/get-all-products')->remove('sitemap/index/get-all-pages');
}
示例2: init
public function init()
{
$categories = Axis::single('catalog/category')->select('*')->addName(Axis_Locale::getLanguageId())->addKeyWord()->order('cc.lft')->addSiteFilter(Axis::getSiteId())->addDisabledFilter()->fetchAll();
if (!is_array($this->_activeCategories)) {
$this->_activeCategories = array();
if (Zend_Registry::isRegistered('catalog/current_category')) {
$this->_activeCategories = array_keys(Zend_Registry::get('catalog/current_category')->cache()->getParentItems());
}
}
$container = $_container = new Zend_Navigation();
$lvl = 0;
$view = $this->getView();
foreach ($categories as $_category) {
$uri = $view->hurl(array('cat' => array('value' => $_category['id'], 'seo' => $_category['key_word']), 'controller' => 'catalog', 'action' => 'view'), false, true);
$class = 'nav-' . str_replace('.', '-', $_category['key_word']);
$page = new Zend_Navigation_Page_Uri(array('label' => $_category['name'], 'title' => $_category['name'], 'uri' => $uri, 'order' => $_category['lft'], 'class' => $class, 'visible' => 'enabled' === $_category['status'] ? true : false, 'active' => in_array($_category['id'], $this->_activeCategories)));
$lvl = $lvl - $_category['lvl'] + 1;
for ($i = 0; $i < $lvl; $i++) {
$_container = $_container->getParent();
}
$lvl = $_category['lvl'];
$_container->addPage($page);
$_container = $page;
}
$this->setData('menu', $container);
return true;
}
示例3: registerAction
public function registerAction()
{
if (Axis::getCustomerId()) {
$this->_redirect('account');
}
$this->setTitle(Axis::translate('account')->__('Create an Account'));
$form = Axis::single('account/form_signup');
if ($this->getRequest()->isPost()) {
$data = $this->getRequest()->getPost();
if ($form->isValid($data)) {
$model = Axis::single('account/customer');
$data['site_id'] = Axis::getSiteId();
$data['is_active'] = 1;
list($row, $password) = $model->create($data);
$row->setDetails($data);
Axis::dispatch('account_customer_register_success', array('customer' => $row, 'password' => $password));
$model->login($data['email'], $password);
return $this->_redirect('account');
} else {
$form->populate($data);
}
}
$this->view->formSignup = $form;
$this->render();
}
示例4: up
public function up()
{
$_pickup = array('RDP' => Axis_ShippingUps_Model_Option_Standard_Pickup::RDP, 'CC' => Axis_ShippingUps_Model_Option_Standard_Pickup::CC, 'OTP' => Axis_ShippingUps_Model_Option_Standard_Pickup::OTP, 'OCA' => Axis_ShippingUps_Model_Option_Standard_Pickup::OCA, 'LC' => Axis_ShippingUps_Model_Option_Standard_Pickup::LC);
$rowset = Axis::single('core/config_value')->select()->where('path = ?', 'shipping/Ups_Standard/pickup')->fetchRowset();
foreach ($rowset as $row) {
$row->value = isset($_pickup[$row->value]) ? $_pickup[$row->value] : Axis_ShippingUps_Model_Option_Standard_Pickup::CC;
$row->save();
}
///////////////////////////
$_package = array('CP' => Axis_ShippingUps_Model_Option_Standard_Package::CP, 'ULE' => Axis_ShippingUps_Model_Option_Standard_Package::ULE, 'UT' => Axis_ShippingUps_Model_Option_Standard_Package::UT, 'UEB' => Axis_ShippingUps_Model_Option_Standard_Package::UEB);
$rowset = Axis::single('core/config_value')->select()->where('path = ?', 'shipping/Ups_Standard/package')->fetchRowset();
foreach ($rowset as $row) {
$row->value = isset($_package[$row->value]) ? $_package[$row->value] : Axis_ShippingUps_Model_Option_Standard_Package::CP;
$row->save();
}
///////////////////////////
$_dest = array('RES' => Axis_ShippingUps_Model_Option_Standard_DestinationType::RES, 'COM' => Axis_ShippingUps_Model_Option_Standard_DestinationType::COM);
$rowset = Axis::single('core/config_value')->select()->where('path = ?', 'shipping/Ups_Standard/res')->fetchRowset();
foreach ($rowset as $row) {
$row->value = isset($_dest[$row->value]) ? $_dest[$row->value] : Axis_ShippingUps_Model_Option_Standard_DestinationType::RES;
$row->save();
}
///////////////////////////
$paths = array('shipping/Ups_Standard/pickup' => 'shippingUps/option_standard_pickup', 'shipping/Ups_Standard/package' => 'shippingUps/option_standard_package', 'shipping/Ups_Standard/res' => 'shippingUps/option_standard_destinationType', 'shipping/Ups_Standard/measure' => 'shippingUps/option_standard_measure', 'shipping/Ups_Standard/type' => 'shippingUps/option_standard_requestType', 'shipping/Ups_Standard/types' => 'shippingUps/option_standard_service', 'shipping/Ups_Standard/xmlOrigin' => 'shippingUps/option_standard_origin');
$rowset = Axis::single('core/config_field')->select()->fetchRowset();
foreach ($rowset as $row) {
if (isset($paths[$row->path])) {
$row->model = $paths[$row->path];
$row->save();
}
}
}
示例5: getName
/**
*
* @static
* @param string $code
* @return string
*/
public static function getName($code)
{
if (!$code) {
return '';
}
return Axis::single('locale/currency')->getTitleByCode($code);
}
示例6: _initSeoParams
private function _initSeoParams($keywords)
{
if (!sizeof($keywords)) {
return array();
}
$rowset = Axis::single('catalog/hurl')->select()->where('key_word IN (?)', $keywords)->where('site_id = ?', Axis::getSiteId())->fetchAssoc();
foreach ($rowset as $row) {
switch ($row['key_type']) {
case 'c':
$this->_params['cat']['value'] = $row['key_id'];
if (empty($this->_params['cat']['seo'])) {
$this->_params['cat']['seo'] = $row['key_word'];
} else {
$this->_params['cat']['seo'] .= '/' . $row['key_word'];
}
break;
case 'p':
$this->_params['product']['value'] = $row['key_id'];
$this->_params['product']['seo'] = $row['key_word'];
$this->getRequest()->setParam('product', $row['key_id']);
break;
case 'm':
$mDescription = Axis::single('catalog/product_manufacturer_description')->select(array('title', 'description'))->where('manufacturer_id = ?', $row['key_id'])->where('language_id = ?', Axis_Locale::getLanguageId())->fetchRow();
$this->_params['manufacturer'] = array('value' => $row['key_id'], 'seo' => $row['key_word'], 'title' => $mDescription->title, 'description' => $mDescription->description);
break;
default:
break;
}
}
}
示例7: removeAction
public function removeAction()
{
$customerGroupIds = Zend_Json::decode($this->_getParam('data'));
$isValid = true;
if (in_array(Axis_Account_Model_Customer_Group::GROUP_GUEST_ID, $customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__("Your can't delete default Guest group id: %s ", Axis_Account_Model_Customer_Group));
}
if (in_array(Axis_Account_Model_Customer_Group::GROUP_ALL_ID, $customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__("Your can't delete default All group id: %s ", Axis_Account_Model_Customer_Group::GROUP_ALL_ID));
}
if (true === in_array(Axis::config()->account->main->defaultCustomerGroup, $customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__("Your can't delete default customer group id: %s ", $id));
}
if (!sizeof($customerGroupIds)) {
$isValid = false;
Axis::message()->addError(Axis::translate('admin')->__('No data to delete'));
}
if ($isValid) {
Axis::single('account/customer_group')->delete($this->db->quoteInto('id IN(?)', $customerGroupIds));
Axis::message()->addSuccess(Axis::translate('admin')->__('Group was deleted successfully'));
}
$this->_helper->json->sendJson(array('success' => $isValid));
}
示例8: up
public function up()
{
$installer = $this->getInstaller();
$installer->run("\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('community_media')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('community_media')}` (\n `id` int(10) unsigned NOT NULL auto_increment,\n `path` varchar(255) NOT NULL,\n `product_id` int(10) unsigned default NULL,\n `customer_id` int(10) unsigned default NULL,\n `status` enum('pending','approved','disapproved') NOT NULL,\n `size` double NOT NULL,\n `date_uploaded` datetime NOT NULL,\n `author` varchar(128) NOT NULL,\n `title` varchar(128) NOT NULL,\n `description` varchar(255) NOT NULL,\n `media_type` enum('video','image') NOT NULL,\n `width` smallint(5) unsigned NOT NULL default '0',\n `height` smallint(5) unsigned NOT NULL default '0',\n PRIMARY KEY (`id`),\n KEY `FK_community_media_product` (`product_id`),\n KEY `FK_community_media_customer` (`customer_id`),\n CONSTRAINT `FK_community_media_customer` FOREIGN KEY (`customer_id`) REFERENCES `{$installer->getTable('account_customer')}` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,\n CONSTRAINT `FK_community_media_product` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product')}` (`id`) ON DELETE SET NULL ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('community_review')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('community_review')}` (\n `id` int(10) unsigned NOT NULL auto_increment,\n `product_id` int(10) unsigned NOT NULL,\n `customer_id` int(10) unsigned default NULL,\n `status` enum('pending','approved','disapproved') NOT NULL,\n `summary` text NOT NULL,\n `author` varchar(128) NOT NULL,\n `title` varchar(128) NOT NULL,\n `date_created` datetime NOT NULL,\n `pros` varchar(255) NOT NULL,\n `cons` varchar(255) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `FK_community_review_customer` (`customer_id`),\n CONSTRAINT `FK_community_review_customer` FOREIGN KEY (`customer_id`) REFERENCES `{$installer->getTable('account_customer')}` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,\n CONSTRAINT `FK_community_review_product` FOREIGN KEY (`product_id`) REFERENCES `{$installer->getTable('catalog_product')}` (`id`) ON DELETE CASCADE ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('community_review_mark')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('community_review_mark')}` (\n `review_id` int(10) unsigned NOT NULL default '0',\n `rating_id` int(10) unsigned NOT NULL,\n `mark` float default NULL,\n PRIMARY KEY (`review_id`,`rating_id`),\n KEY `FK_community_review_mark_rating` (`rating_id`),\n CONSTRAINT `FK_community_review_mark_review` FOREIGN KEY (`review_id`) REFERENCES `{$installer->getTable('community_review')}` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,\n CONSTRAINT `FK_community_review_mark_rating` FOREIGN KEY (`rating_id`) REFERENCES `{$installer->getTable('community_review_rating')}` (`id`) ON DELETE CASCADE ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('community_review_rating')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('community_review_rating')}` (\n `id` int(10) unsigned NOT NULL auto_increment,\n `name` varchar(64) NOT NULL,\n `status` enum('enabled','disabled') NOT NULL,\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;\n\n INSERT INTO `{$installer->getTable('community_review_rating')}` (`id`, `status`, `name`) VALUES\n (1, 'enabled', 'price'),\n (2, 'enabled', 'quality'),\n (3, 'enabled', 'value');\n\n -- DROP TABLE IF EXISTS `{$installer->getTable('community_review_rating_title')}`;\n CREATE TABLE IF NOT EXISTS `{$installer->getTable('community_review_rating_title')}` (\n `rating_id` int(10) unsigned NOT NULL,\n `language_id` smallint(5) unsigned NOT NULL,\n `title` varchar(128) NOT NULL,\n PRIMARY KEY USING BTREE (`rating_id`,`language_id`),\n KEY `FK_community_review_rating_title_language_id` (`language_id`),\n CONSTRAINT `FK_community_review_rating_title_language_id` FOREIGN KEY (`language_id`) REFERENCES `{$installer->getTable('locale_language')}` (`id`) ON DELETE CASCADE,\n CONSTRAINT `FK_community_review_rating_title_rating_id` FOREIGN KEY (`rating_id`) REFERENCES `{$installer->getTable('community_review_rating')}` (`id`) ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n ");
$titles = array('Price', 'Quality', 'Value');
$languages = Axis::model('locale/option_language');
$mRatingTitle = Axis::model('community/review_rating_title');
foreach (Axis::model('community/review_rating')->fetchAll() as $rating) {
foreach ($languages as $languageId => $languageName) {
$mRatingTitle->createRow(array('rating_id' => $rating->id, 'language_id' => $languageId, 'title' => $titles[$rating->id - 1]))->save();
}
}
$this->getConfigBuilder()->section('community', 'Community')->setTranslation('Axis_Community')->section('review', 'Reviews')->option('enabled', 'Enabled', true)->setType('radio')->setModel('core/option_boolean')->option('rating_enabled', 'Enable ratings', true)->setType('radio')->setDescription('Enable rating system in reviews')->setModel('core/option_boolean')->option('rating_title', 'Show rating title', true)->setType('radio')->setDescription('Show rating titles')->setModel('core/option_boolean')->option('merge_average', 'Merge average ratings', true)->setType('radio')->setDescription('Show average rating as one')->setModel('core/option_boolean')->option('customer_status', 'Default customer review status')->setValue(Axis_Community_Model_Option_Review_Status::PENDING)->setType('select')->setDescription('Default review status written by registered customer')->setModel('community/option_review_status')->option('guest_status', 'Default guest review status')->setValue(Axis_Community_Model_Option_Review_Status::PENDING)->setType('select')->setDescription('Default review status written by guest')->setModel('community/option_review_status')->option('guest_permission', 'Allow guest to write a reviews', true)->setType('radio')->setModel('core/option_boolean')->option('perPage', 'Reviews showed per page', '10,25,50,all')->option('perPageDefault', 'Default reviews count per page', '10')->section('/review')->section('/');
Axis::single('account/customer_field')->add(array('nickname' => 'Nickname'), array('community' => 'Community'), array('validator' => 'Alnum', 'axis_validator' => 'Axis_Community_Validate_Nickname'));
Axis::single('core/page')->add('community/*/*')->add('community/review/*')->add('community/review/index')->add('community/review/detail')->add('community/review/product')->add('community/review/customer');
/*->add('community/image/*')
->add('community/image/index')
->add('community/image/detail')
->add('community/image/product')
->add('community/image/customer')
->add('community/video/*')
->add('community/video/index')
->add('community/video/detail')
->add('community/video/product')
->add('community/video/customer');*/
}
示例9: getName
/**
*
* @static
* @param int $id
* @return string
*/
public static function getName($id)
{
if (!$id) {
return '';
}
return Axis::single('account/customer_group')->getNameById($id);
}
示例10: down
public function down()
{
$installer = Axis::single('install/installer');
$installer->run("\n DROP TABLE IF EXISTS `{$installer->getTable('shippingtable_rate')}`;\n ");
Axis::single('core/config_value')->remove('shipping/Table_Standard');
Axis::single('core/config_field')->remove('shipping/Table_Standard');
}
示例11: _calculateShippingTax
function _calculateShippingTax($price, Axis_Method_Shipping_Model_Abstract $shipping, array $params)
{
$customerGroupId = $params['customer_group_id'];
if (!($taxClassId = $shipping->config()->taxClass)) {
if (!($taxClassId = Axis::config()->tax->shipping->taxClass)) {
return 0;
}
}
if (!($taxBasis = $shipping->config()->taxBasis)) {
if (!($taxBasis = Axis::config()->tax->shipping->taxBasis)) {
return 0;
}
}
if ('billing' === $taxBasis) {
$countryId = $params['billing_country_id'];
$zoneId = $params['billing_zone_id'];
} else {
$countryId = $params['delivery_country_id'];
$zoneId = $params['delivery_zone_id'];
}
if (empty($zoneId)) {
$zoneId = null;
}
$geozoneIds = Axis::single('location/geozone')->getIds($countryId, $zoneId);
if (empty($geozoneIds)) {
return 0;
}
return Axis::single('tax/rate')->calculateByPrice($price, $taxClassId, $geozoneIds, $customerGroupId);
}
示例12: addAction
public function addAction()
{
$pageId = $this->_getParam('page');
$this->view->page = array();
$currentPage = Axis::single('cms/page')->cache()->find($pageId)->current();
if (!$currentPage) {
$this->setTitle(Axis::translate('cms')->__('Page not found'));
$this->render();
return;
}
$categories = Axis::single('cms/category')->getParentCategory($pageId, true);
foreach ($categories as $_category) {
$label = empty($_category['title']) ? $_category['link'] : $_category['title'];
$this->_helper->breadcrumbs(array('label' => $label, 'params' => array('cat' => $_category['link']), 'route' => 'cms_category'));
}
$rowContent = $currentPage->cache()->getContent();
$this->setTitle($rowContent->title);
$page = array('content' => $rowContent->content, 'is_commented' => (bool) $currentPage->comment);
if ($currentPage->comment) {
// get all comments
$comments = $currentPage->cache()->getComments();
foreach ($comments as $comment) {
$page['comment'][] = $comment;
}
$this->_addCommentForm($pageId);
}
$this->view->page = $page;
$metaTitle = empty($rowContent->meta_title) ? $rowContent->title : $rowContent->meta_title;
$this->view->meta()->setTitle($metaTitle, 'cms_page', $pageId)->setDescription($rowContent->meta_description)->setKeywords($rowContent->meta_keyword);
$this->_helper->layout->setLayout($currentPage->layout);
$this->render();
}
示例13: down
public function down()
{
$installer = Axis::single('install/installer');
$installer->run("\n DROP TABLE IF EXISTS `{$installer->getTable('poll_answer')}`;\n DROP TABLE IF EXISTS `{$installer->getTable('poll_question')}`;\n DROP TABLE IF EXISTS `{$installer->getTable('poll_question_description')}`;\n DROP TABLE IF EXISTS `{$installer->getTable('poll_question_site')}`;\n DROP TABLE IF EXISTS `{$installer->getTable('poll_vote')}`;\n ");
//Axis::single('core/template_box')->remove('Axis_Poll_Poll');
Axis::single('core/page')->remove('poll/*/*');
}
示例14: getName
/**
*
* @static
* @param string $id
* @return string
*/
public static function getName($id)
{
if (!$id) {
return '';
}
return Axis::single('tax/class')->getNameById($id);
}
示例15: getList
/**
* Retrieve the list of all boxes, including active cms boxes
*
* @param bool $includeCms
* @return array
*/
public function getList($includeCms = true)
{
$modules = Axis::single('core/module')->getList();
if (!($boxes = Axis::cache()->load('boxes_list'))) {
$boxes = array();
foreach ($modules as $moduleCode => $values) {
list($namespace, $module) = explode('_', $moduleCode, 2);
$path = Axis::config()->system->path . '/app/code/' . $namespace . '/' . $module . '/Box';
if (!is_readable($path)) {
continue;
}
$dir = opendir($path);
while ($file = readdir($dir)) {
if (!is_readable($path . '/' . $file) || !is_file($path . '/' . $file)) {
continue;
}
$box = substr($file, 0, strpos($file, '.'));
if (in_array($box, array('Abstract', 'Block'))) {
continue;
}
$boxes[] = ucwords($namespace . '_' . $module . '_' . $box);
}
}
Axis::cache()->save($boxes, 'boxes_list', array('modules'));
}
/* this part is not needed to be cached */
if ($includeCms && in_array('Axis_Cms', array_keys($modules))) {
$cmsBoxes = Axis::model('cms/block')->select('*')->where('is_active = 1')->fetchAll();
foreach ($cmsBoxes as $box) {
$boxes[] = 'Axis_Cms_Block_' . $box['name'];
}
}
sort($boxes);
return $boxes;
}