本文整理汇总了PHP中VmTable类的典型用法代码示例。如果您正苦于以下问题:PHP VmTable类的具体用法?PHP VmTable怎么用?PHP VmTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VmTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getShipment
/**
* Retrieve the detail record for the current $id if the data has not already been loaded.
*
* @author RickG
*/
function getShipment($id = 0)
{
if (!empty($id)) {
$this->_id = (int) $id;
}
if (empty($this->_cache[$this->_id])) {
$this->_cache[$this->_id] = $this->getTable('shipmentmethods');
$this->_cache[$this->_id]->load((int) $this->_id);
if (empty($this->_cache[$this->_id]->virtuemart_vendor_id)) {
if (!class_exists('VirtueMartModelVendor')) {
require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'vendor.php';
}
$this->_cache[$this->_id]->virtuemart_vendor_id = VirtueMartModelVendor::getLoggedVendor();
}
if ($this->_cache[$this->_id]->shipment_jplugin_id) {
JPluginHelper::importPlugin('vmshipment');
$dispatcher = JDispatcher::getInstance();
$blind = 0;
$retValue = $dispatcher->trigger('plgVmDeclarePluginParamsShipmentVM3', array(&$this->_cache[$this->_id]));
}
if (!empty($this->_cache[$this->_id]->_varsToPushParam)) {
VmTable::bindParameterable($this->_cache[$this->_id], 'shipment_params', $this->_cache[$this->_id]->_varsToPushParam);
}
/* Add the shipmentcarreir shoppergroups */
$q = 'SELECT `virtuemart_shoppergroup_id` FROM #__virtuemart_shipmentmethod_shoppergroups WHERE `virtuemart_shipmentmethod_id` = "' . $this->_id . '"';
$this->_db->setQuery($q);
$this->_cache[$this->_id]->virtuemart_shoppergroup_ids = $this->_db->loadResultArray();
if (empty($this->_cache[$this->_id]->virtuemart_shoppergroup_ids)) {
$this->_cache[$this->_id]->virtuemart_shoppergroup_ids = 0;
}
}
return $this->_cache[$this->_id];
}
示例2: display
function display($tpl = null)
{
// Load the helper(s)
$this->addHelperPath(VMPATH_ADMIN . DS . 'helpers');
if (!class_exists('vmPSPlugin')) {
require VMPATH_PLUGINLIBS . DS . 'vmpsplugin.php';
}
if (!class_exists('VmHTML')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'html.php';
}
$model = VmModel::getModel();
$layoutName = vRequest::getCmd('layout', 'default');
$this->SetViewTitle();
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(VMPATH_ADMIN . DS . 'fields');
$shipment = $model->getShipment();
// Get the payment XML.
$formFile = vRequest::filterPath(VMPATH_ROOT . DS . 'plugins' . DS . 'vmshipment' . DS . $shipment->shipment_element . DS . $shipment->shipment_element . '.xml');
if (file_exists($formFile)) {
$shipment->form = JForm::getInstance($shipment->shipment_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$shipment->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushFromForm($shipment->form);
VmTable::bindParameterableToSubField($shipment, $varsToPush);
$shipment->form->bind($shipment->getProperties());
} else {
$shipment->form = null;
}
if (!class_exists('VmImage')) {
require VMPATH_ADMIN . DS . 'helpers' . DS . 'image.php';
}
if (!class_exists('VirtueMartModelVendor')) {
require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
}
$vendor_id = 1;
$currency = VirtueMartModelVendor::getVendorCurrency($vendor_id);
$this->assignRef('vendor_currency', $currency->currency_symbol);
if ($this->showVendors()) {
$vendorList = ShopFunctions::renderVendorList($shipment->virtuemart_vendor_id);
$this->assignRef('vendorList', $vendorList);
}
$this->pluginList = self::renderInstalledShipmentPlugins($shipment->shipment_jplugin_id);
$this->assignRef('shipment', $shipment);
$this->shopperGroupList = ShopFunctions::renderShopperGroupList($shipment->virtuemart_shoppergroup_ids, true);
$this->addStandardEditViewCommands($shipment->virtuemart_shipmentmethod_id);
} else {
JToolBarHelper::custom('cloneshipment', 'copy', 'copy', vmText::_('COM_VIRTUEMART_SHIPMENT_CLONE'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$this->shipments = $model->getShipments();
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
foreach ($this->shipments as &$data) {
// Write the first 5 shoppergroups in the list
$data->shipmentShoppersList = shopfunctions::renderGuiList($data->virtuemart_shoppergroup_ids, 'shoppergroups', 'shopper_group_name', 'shopper');
}
$this->pagination = $model->getPagination();
}
parent::display($tpl);
}
示例3: display
function display($tpl = null)
{
// Load the helper(s)
if (!class_exists('VmHTML')) {
require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'html.php';
}
if (!class_exists('vmCustomPlugin')) {
require JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php';
}
$model = VmModel::getModel('custom');
// TODO Make an Icon for custom
$this->SetViewTitle('PRODUCT_CUSTOM_FIELD');
$layoutName = vRequest::getCmd('layout', 'default');
if ($layoutName == 'edit') {
$this->addStandardEditViewCommands();
$customPlugin = '';
$this->custom = $model->getCustom();
$customfields = VmModel::getModel('customfields');
//vmdebug('VirtuemartViewCustom',$this->custom);
JPluginHelper::importPlugin('vmcustom');
$dispatcher = JDispatcher::getInstance();
$retValue = $dispatcher->trigger('plgVmOnDisplayEdit', array($this->custom->virtuemart_custom_id, &$customPlugin));
$this->SetViewTitle('PRODUCT_CUSTOM_FIELD', $this->custom->custom_title);
$selected = 0;
if (!empty($this->custom->custom_jplugin_id)) {
VmConfig::loadJLang('plg_vmpsplugin', false);
JForm::addFieldPath(JPATH_VM_ADMINISTRATOR . DS . 'fields');
$selected = $this->custom->custom_jplugin_id;
// Get the payment XML.
$formFile = JPath::clean(JPATH_ROOT . DS . 'plugins' . DS . 'vmcustom' . DS . $this->custom->custom_element . DS . $this->custom->custom_element . '.xml');
if (file_exists($formFile)) {
$this->custom->form = JForm::getInstance($this->custom->custom_element, $formFile, array(), false, '//vmconfig | //config[not(//vmconfig)]');
$this->custom->params = new stdClass();
$varsToPush = vmPlugin::getVarsToPushByXML($formFile, 'customForm');
$this->custom->params->custom_params = $this->custom->custom_params;
VmTable::bindParameterable($this->custom->params, 'custom_params', $varsToPush);
$this->custom->form->bind($this->custom);
} else {
$this->custom->form = null;
}
}
$this->pluginList = self::renderInstalledCustomPlugins($selected);
$this->assignRef('customPlugin', $customPlugin);
$this->assignRef('customfields', $customfields);
} else {
JToolBarHelper::custom('createClone', 'copy', 'copy', vmText::_('COM_VIRTUEMART_CLONE'), true);
JToolBarHelper::custom('toggle.admin_only.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
JToolBarHelper::custom('toggle.admin_only.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_ADMIN'), true);
JToolBarHelper::custom('toggle.is_hidden.1', 'publish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
JToolBarHelper::custom('toggle.is_hidden.0', 'unpublish', '', vmText::_('COM_VIRTUEMART_TOGGLE_HIDDEN'), true);
$this->addStandardDefaultViewCommands();
$this->addStandardDefaultViewLists($model);
$customs = $model->getCustoms(vRequest::getInt('custom_parent_id'), vRequest::getCmd('keyword'));
$this->assignRef('customs', $customs);
$pagination = $model->getPagination();
$this->assignRef('pagination', $pagination);
}
parent::display($tpl);
}
示例4: __construct
/**
* @author Max Milbers
* @param JDataBase $db
*/
function __construct(&$db)
{
parent::__construct('#__virtuemart_ratings', 'virtuemart_rating_id', $db);
//In a VmTable the primary key is the same as the _tbl_key and therefore not needed
$this->setPrimaryKey('virtuemart_rating_id');
// $this->setObligatoryKeys('virtuemart_product_id');
$this->setLoggable();
$this->setTableShortCut('r');
}
示例5:
/**
* @author Max Milbers
* @param JDataBase $db
*/
function __construct(&$db)
{
parent::__construct('#__virtuemart_rating_reviews', 'virtuemart_rating_review_id', $db);
$this->setPrimaryKey('virtuemart_rating_review_id');
$this->setObligatoryKeys('comment');
$this->setLoggable();
}
示例6: check
function check()
{
if (empty($this->shopper_group_name)) {
vmError(JText::_('COM_VIRTUEMART_SHOPPERGROUP_RECORDS_MUST_HAVE_NAME'));
return false;
} else {
if (function_exists('mb_strlen')) {
if (mb_strlen($this->shopper_group_name) > 32) {
vmError(JText::_('COM_VIRTUEMART_SHOPPERGROUP_NAME_LESS_THAN_32_CHARACTERS'));
return false;
}
} else {
if (strlen($this->shopper_group_name) > 32) {
vmError(JText::_('COM_VIRTUEMART_SHOPPERGROUP_NAME_LESS_THAN_32_CHARACTERS'));
return false;
}
}
}
/* commented by PATRICK This set always shoppergroup to 1 if you do a new shoppergroup
if(empty($this->virtuemart_shoppergroup_id)){
$q = 'SELECT `virtuemart_shoppergroup_id` FROM `#__virtuemart_shoppergroups` WHERE `default`="1" AND `virtuemart_vendor_id`="1" ';
$this->_db->setQuery($q);
$this->virtuemart_shoppergroup_id=$this->_db->loadResult();
}
*/
return parent::check();
}
示例7:
function __construct(&$db)
{
parent::__construct('#__virtuemart_calcs', 'virtuemart_calc_id', $db);
$this->setObligatoryKeys('calc_name');
$this->setObligatoryKeys('calc_kind');
$this->setLoggable();
}
示例8: check
function check()
{
if (empty($this->shopper_group_name)) {
vmError('COM_VIRTUEMART_SHOPPERGROUP_RECORDS_MUST_HAVE_NAME');
return false;
} else {
if (function_exists('mb_strlen')) {
$length = mb_strlen($this->shopper_group_name);
} else {
$length = strlen($this->shopper_group_name);
}
if ($length > 128) {
vmError('COM_VIRTUEMART_SHOPPERGROUP_NAME_128');
}
}
if ($this->virtuemart_shoppergroup_id == 1) {
$this->default = 2;
$this->sgrp_additional = 0;
}
if ($this->virtuemart_shoppergroup_id == 2) {
$this->default = 1;
$this->sgrp_additional = 0;
}
return parent::check();
}
示例9:
function __construct(&$db)
{
parent::__construct('#__virtuemart_shoppergroups', 'virtuemart_shoppergroup_id', $db);
$this->setUniqueName('shopper_group_name');
$this->setLoggable();
$this->setTableShortCut('sg');
}
示例10:
/**
*
* @author Max Milbers
* @param $db Class constructor; connect to the database
*
*/
function __construct($db)
{
parent::__construct('#__virtuemart_invoices', 'virtuemart_invoice_id', $db);
$this->setUniqueName('invoice_number');
$this->setLoggable();
$this->setTableShortCut('inv');
}
示例11:
/**
* @author Max Milbers
* @param $db A database connector object
*/
function __construct(&$db)
{
parent::__construct('#__virtuemart_rating_votes', 'virtuemart_rating_vote_id', $db);
$this->setPrimaryKey('virtuemart_product_id');
// $this->setObligatoryKeys('vote');
$this->setLoggable();
}
示例12:
/**
* @author Patrick Kohl
* @param JDataBase $db
*/
function __construct(&$db)
{
parent::__construct('#__virtuemart_customs', 'virtuemart_custom_id', $db);
$this->setUniqueName('custom_title');
$this->setObligatoryKeys('field_type');
$this->setLoggable();
$this->setOrderable('ordering', false);
}
示例13: check
/**
* Validates the userfields record fields.
*
* @return boolean True if the table buffer is contains valid data, false otherwise.
*/
function check($nrOfValues)
{
if (preg_match('/[^a-z0-9\\._\\-]/i', $this->group_name) > 0) {
vmError(JText::_('COM_VIRTUEMART_PERMISSION_GROUP_NAME_INVALID_CHARACTERS'));
return false;
}
return parent::check();
}
示例14:
/**
* @author Max Milbers
* @param $db A database connector object
*/
function __construct(&$db)
{
parent::__construct('#__virtuemart_product_customfields', 'virtuemart_customfield_id', $db);
$this->setPrimaryKey('virtuemart_product_id');
// $this->setSecondaryKey('virtuemart_customfield_id');
$this->setLoggable();
$this->setOrderable();
}
示例15: check
function check()
{
if (empty($this->notify_email) || !filter_var($this->notify_email, FILTER_VALIDATE_EMAIL)) {
vmError(JText::_('COM_VIRTUEMART_ENTER_A_VALID_EMAIL_ADDRESS'), JText::_('COM_VIRTUEMART_ENTER_A_VALID_EMAIL_ADDRESS'));
return false;
}
return parent::check();
}