本文整理汇总了PHP中Category::Load方法的典型用法代码示例。如果您正苦于以下问题:PHP Category::Load方法的具体用法?PHP Category::Load怎么用?PHP Category::Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Category
的用法示例。
在下文中一共展示了Category::Load方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: category
public function category()
{
$col_name = "placement_category_id";
$category = null;
if (isset($this->{$col_name}) && is_numeric($this->{$col_name})) {
$category_id = $this->{$col_name};
$entry = $this->entry();
if (empty($entry)) {
return null;
}
if ($entry->class === 'entry') {
require_once 'class.mt_category.php';
$category = new Category();
$loaded = $category->Load("category_id = {$category_id}");
} else {
require_once 'class.mt_folder.php';
$category = new Folder();
$loaded = $category->Load("category_id = {$category_id}");
}
if (!$loaded) {
$category = null;
}
}
return $category;
}
示例2: category
public function category()
{
$col_name = "fileinfo_category_id";
$category = null;
if (isset($this->{$col_name}) && is_numeric($this->{$col_name})) {
$category_id = $this->{$col_name};
require_once 'class.mt_category.php';
$category = new Category();
$category->Load("category_id = {$category_id}");
}
return $category;
}
示例3: SetupCategory
protected function SetupCategory()
{
// Lookup Object PK information from Query String (if applicable)
// Set mode to Edit or New depending on what's found
$intCategoryId = QApplication::QueryString('intCategoryId');
if ($intCategoryId) {
$this->objCategory = Category::Load($intCategoryId);
if (!$this->objCategory) {
throw new Exception('Could not find a Category object with PK arguments: ' . $intCategoryId);
}
$this->strTitleVerb = QApplication::Translate('Edit');
$this->blnEditMode = true;
} else {
$this->objCategory = new Category();
$this->strTitleVerb = QApplication::Translate('Create');
$this->blnEditMode = false;
}
}
示例4: __get
/**
* Override method to perform a property "Get"
* This will get the value of $strName
*
* @param string $strName Name of the property to get
* @return mixed
*/
public function __get($strName)
{
switch ($strName) {
///////////////////
// Member Variables
///////////////////
case 'InventoryModelId':
/**
* Gets the value for intInventoryModelId (Read-Only PK)
* @return integer
*/
return $this->intInventoryModelId;
case 'CategoryId':
/**
* Gets the value for intCategoryId
* @return integer
*/
return $this->intCategoryId;
case 'ManufacturerId':
/**
* Gets the value for intManufacturerId
* @return integer
*/
return $this->intManufacturerId;
case 'InventoryModelCode':
/**
* Gets the value for strInventoryModelCode (Unique)
* @return string
*/
return $this->strInventoryModelCode;
case 'ShortDescription':
/**
* Gets the value for strShortDescription (Not Null)
* @return string
*/
return $this->strShortDescription;
case 'LongDescription':
/**
* Gets the value for strLongDescription
* @return string
*/
return $this->strLongDescription;
case 'ImagePath':
/**
* Gets the value for strImagePath
* @return string
*/
return $this->strImagePath;
case 'Price':
/**
* Gets the value for fltPrice
* @return double
*/
return $this->fltPrice;
case 'CreatedBy':
/**
* Gets the value for intCreatedBy
* @return integer
*/
return $this->intCreatedBy;
case 'CreationDate':
/**
* Gets the value for dttCreationDate
* @return QDateTime
*/
return $this->dttCreationDate;
case 'ModifiedBy':
/**
* Gets the value for intModifiedBy
* @return integer
*/
return $this->intModifiedBy;
case 'ModifiedDate':
/**
* Gets the value for strModifiedDate (Read-Only Timestamp)
* @return string
*/
return $this->strModifiedDate;
///////////////////
// Member Objects
///////////////////
///////////////////
// Member Objects
///////////////////
case 'Category':
/**
* Gets the value for the Category object referenced by intCategoryId
* @return Category
*/
try {
if (!$this->objCategory && !is_null($this->intCategoryId)) {
$this->objCategory = Category::Load($this->intCategoryId);
}
//.........这里部分代码省略.........
示例5: Create
/**
* Static Helper Method to Create using PK arguments
* You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
* If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
* static helper methods. Finally, specify a CreateType to define whether or not we are only allowed to
* edit, or if we are also allowed to create a new one, etc.
*
* @param mixed $objParentObject QForm or QPanel which will be using this CategoryMetaControl
* @param integer $intCategoryId primary key value
* @param QMetaControlCreateType $intCreateType rules governing Category object creation - defaults to CreateOrEdit
* @return CategoryMetaControl
*/
public static function Create($objParentObject, $intCategoryId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit)
{
// Attempt to Load from PK Arguments
if (strlen($intCategoryId)) {
$objCategory = Category::Load($intCategoryId);
// Category was found -- return it!
if ($objCategory) {
return new CategoryMetaControl($objParentObject, $objCategory);
} else {
if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound) {
throw new QCallerException('Could not find a Category object with PK arguments: ' . $intCategoryId);
}
}
// If EditOnly is specified, throw an exception
} else {
if ($intCreateType == QMetaControlCreateType::EditOnly) {
throw new QCallerException('No PK arguments specified');
}
}
// If we are here, then we need to create a new record
return new CategoryMetaControl($objParentObject, new Category());
}
示例6: Reload
/**
* Reload this Category from the database.
* @return void
*/
public function Reload()
{
// Make sure we are actually Restored from the database
if (!$this->__blnRestored) {
throw new QCallerException('Cannot call Reload() on a new, unsaved Category object.');
}
// Reload the Object
$objReloaded = Category::Load($this->intCategoryId);
// Update $this's local variables to match
$this->strShortDescription = $objReloaded->strShortDescription;
$this->strLongDescription = $objReloaded->strLongDescription;
$this->strImagePath = $objReloaded->strImagePath;
$this->blnAssetFlag = $objReloaded->blnAssetFlag;
$this->blnInventoryFlag = $objReloaded->blnInventoryFlag;
$this->CreatedBy = $objReloaded->CreatedBy;
$this->dttCreationDate = $objReloaded->dttCreationDate;
$this->ModifiedBy = $objReloaded->ModifiedBy;
$this->strModifiedDate = $objReloaded->strModifiedDate;
}
示例7: btnEdit_Click
public function btnEdit_Click($strFormId, $strControlId, $strParameter)
{
$strParameterArray = explode(',', $strParameter);
$objCategory = Category::Load($strParameterArray[0]);
$objEditPanel = new CategoryEditPanel($this, $this->strCloseEditPanelMethod, $objCategory);
$strMethodName = $this->strSetEditPanelMethod;
$this->objForm->{$strMethodName}($objEditPanel);
}
示例8: Reload
/**
* Reload this Category from the database.
* @return void
*/
public function Reload()
{
// Make sure we are actually Restored from the database
if (!$this->__blnRestored) {
throw new QCallerException('Cannot call Reload() on a new, unsaved Category object.');
}
// Reload the Object
$objReloaded = Category::Load($this->intId);
// Update $this's local variables to match
$this->intParentId = $objReloaded->intParentId;
$this->strName = $objReloaded->strName;
}
示例9: __get
/**
* Override method to perform a property "Get"
* This will get the value of $strName
*
* @param string $strName Name of the property to get
* @return mixed
*/
public function __get($strName)
{
switch ($strName) {
///////////////////
// Member Variables
///////////////////
case 'InventoryModelId':
// Gets the value for intInventoryModelId (Read-Only PK)
// @return integer
return $this->intInventoryModelId;
case 'CategoryId':
// Gets the value for intCategoryId
// @return integer
return $this->intCategoryId;
case 'ManufacturerId':
// Gets the value for intManufacturerId
// @return integer
return $this->intManufacturerId;
case 'InventoryModelCode':
// Gets the value for strInventoryModelCode (Unique)
// @return string
return $this->strInventoryModelCode;
case 'ShortDescription':
// Gets the value for strShortDescription (Not Null)
// @return string
return $this->strShortDescription;
case 'LongDescription':
// Gets the value for strLongDescription
// @return string
return $this->strLongDescription;
case 'ImagePath':
// Gets the value for strImagePath
// @return string
return $this->strImagePath;
case 'Price':
// Gets the value for fltPrice
// @return double
return $this->fltPrice;
case 'CreatedBy':
// Gets the value for intCreatedBy
// @return integer
return $this->intCreatedBy;
case 'CreationDate':
// Gets the value for dttCreationDate
// @return QDateTime
return $this->dttCreationDate;
case 'ModifiedBy':
// Gets the value for intModifiedBy
// @return integer
return $this->intModifiedBy;
case 'ModifiedDate':
// Gets the value for strModifiedDate (Read-Only Timestamp)
// @return string
return $this->strModifiedDate;
///////////////////
// Member Objects
///////////////////
///////////////////
// Member Objects
///////////////////
case 'Category':
// Gets the value for the Category object referenced by intCategoryId
// @return Category
try {
if (!$this->objCategory && !is_null($this->intCategoryId)) {
$this->objCategory = Category::Load($this->intCategoryId);
}
return $this->objCategory;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'Manufacturer':
// Gets the value for the Manufacturer object referenced by intManufacturerId
// @return Manufacturer
try {
if (!$this->objManufacturer && !is_null($this->intManufacturerId)) {
$this->objManufacturer = Manufacturer::Load($this->intManufacturerId);
}
return $this->objManufacturer;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
case 'CreatedByObject':
// Gets the value for the UserAccount object referenced by intCreatedBy
// @return UserAccount
try {
if (!$this->objCreatedByObject && !is_null($this->intCreatedBy)) {
$this->objCreatedByObject = UserAccount::Load($this->intCreatedBy);
}
return $this->objCreatedByObject;
} catch (QCallerException $objExc) {
//.........这里部分代码省略.........
示例10: __get
/**
* Override method to perform a property "Get"
* This will get the value of $strName
*
* @param string $strName Name of the property to get
* @return mixed
*/
public function __get($strName)
{
switch ($strName) {
///////////////////
// Member Variables
///////////////////
case 'CategoryId':
// Gets the value for intCategoryId (PK)
// @return integer
return $this->intCategoryId;
///////////////////
// Member Objects
///////////////////
///////////////////
// Member Objects
///////////////////
case 'Category':
// Gets the value for the Category object referenced by intCategoryId (PK)
// @return Category
try {
if (!$this->objCategory && !is_null($this->intCategoryId)) {
$this->objCategory = Category::Load($this->intCategoryId);
}
return $this->objCategory;
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
////////////////////////////
// Virtual Object References (Many to Many and Reverse References)
// (If restored via a "Many-to" expansion)
////////////////////////////
////////////////////////////
// Virtual Object References (Many to Many and Reverse References)
// (If restored via a "Many-to" expansion)
////////////////////////////
case '__Restored':
return $this->__blnRestored;
default:
try {
return parent::__get($strName);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}