本文整理汇总了PHP中Asset::LoadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Asset::LoadAll方法的具体用法?PHP Asset::LoadAll怎么用?PHP Asset::LoadAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Asset
的用法示例。
在下文中一共展示了Asset::LoadAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lstParentAsset_Create
protected function lstParentAsset_Create()
{
$this->lstParentAsset = new QListBox($this);
$this->lstParentAsset->Name = QApplication::Translate('Parent Asset');
$this->lstParentAsset->AddItem(QApplication::Translate('- Select One -'), null);
$objParentAssetArray = Asset::LoadAll();
if ($objParentAssetArray) {
foreach ($objParentAssetArray as $objParentAsset) {
$objListItem = new QListItem($objParentAsset->__toString(), $objParentAsset->AssetId);
if ($this->objAsset->ParentAsset && $this->objAsset->ParentAsset->AssetId == $objParentAsset->AssetId) {
$objListItem->Selected = true;
}
$this->lstParentAsset->AddItem($objListItem);
}
}
}
示例2: btnNext_Click
//.........这里部分代码省略.........
if ($txtDefault->Display && $txtDefault->Required && !$txtDefault->Text) {
$txtDefault->Warning = "You must enter default value.";
break;
} else {
$blnError = false;
$txtDefault->Warning = "";
}
}
}
// If all required fields have no errors
if (!$blnError && $blnAssetCode && $blnAssetModelCode && $blnAssetModelShortDescription && $blnLocation && $blnCategory && $blnManufacturer) {
$this->btnNext->Warning = "";
// Setup keys for main required fields
foreach ($this->arrTracmorField as $key => $value) {
if ($value == 'location') {
$this->intLocationKey = $key;
} elseif ($value == 'category') {
$this->intCategoryKey = $key;
} elseif ($value == 'manufacturer') {
$this->intManufacturerKey = $key;
} elseif ($value == 'created by') {
$this->intCreatedByKey = $key;
} elseif ($value == 'created date') {
$this->intCreatedDateKey = $key;
} elseif ($value == 'modified by') {
$this->intModifiedByKey = $key;
} elseif ($value == 'modified date') {
$this->intModifiedDateKey = $key;
}
}
$strLocationArray = array();
$strNewLocationArray = array();
// Load all locations
foreach (Location::LoadAll() as $objLocation) {
$strLocationArray[] = stripslashes($objLocation->ShortDescription);
}
$txtDefaultValue = trim($this->txtMapDefaultValueArray[$this->intLocationKey]->Text);
// Add default value in database if it is not exist
if ($txtDefaultValue && !$this->in_array_nocase($txtDefaultValue, $strLocationArray)) {
$strLocationArray[] = $txtDefaultValue;
$objNewLocation = new Location();
$objNewLocation->ShortDescription = addslashes($txtDefaultValue);
$objNewLocation->EnabledFlag = 1;
$objNewLocation->Save();
$this->objNewLocationArray[$objNewLocation->LocationId] = $objNewLocation->ShortDescription;
}
$this->objNewLocationArray = array();
$this->objNewCategoryArray = array();
$this->objNewManufacturerArray = array();
$this->objNewAssetModelArray = array();
$this->strModelValuesArray = array();
$this->blnImportEnd = false;
$j = 1;
$strLocationValuesArray = array();
// Add all unique locations in database
foreach ($this->strFilePathArray as $strFilePath) {
$this->FileCsvData->load($strFilePath);
if ($j != 1) {
//$this->FileCsvData->appendRow($this->FileCsvData->getHeaders());
}
// Location Import
for ($i = 0; $i < $this->FileCsvData->countRows(); $i++) {
$strRowArray = $this->FileCsvData->getRow($i);
if (trim($strRowArray[$this->intLocationKey]) && !$this->in_array_nocase(trim($strRowArray[$this->intLocationKey]), $strLocationArray)) {
$strLocationArray[] = trim($strRowArray[$this->intLocationKey]);
/*$objNewLocation = new Location();
示例3: dtgAsset_Bind
protected function dtgAsset_Bind()
{
// Because we want to enable pagination AND sorting, we need to setup the $objClauses array to send to LoadAll()
// Remember! We need to first set the TotalItemCount, which will affect the calcuation of LimitClause below
$this->dtgAsset->TotalItemCount = Asset::CountAll();
// Setup the $objClauses Array
$objClauses = array();
// If a column is selected to be sorted, and if that column has a OrderByClause set on it, then let's add
// the OrderByClause to the $objClauses array
if ($objClause = $this->dtgAsset->OrderByClause) {
array_push($objClauses, $objClause);
}
// Add the LimitClause information, as well
if ($objClause = $this->dtgAsset->LimitClause) {
array_push($objClauses, $objClause);
}
// Set the DataSource to be the array of all Asset objects, given the clauses above
$this->dtgAsset->DataSource = Asset::LoadAll($objClauses);
}
示例4: Refresh
/**
* Refresh this MetaControl with Data from the local Asset object.
* @param boolean $blnReload reload Asset from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objAsset->Reload();
}
if ($this->lblAssetId) {
if ($this->blnEditMode) {
$this->lblAssetId->Text = $this->objAsset->AssetId;
}
}
if ($this->lstParentAsset) {
$this->lstParentAsset->RemoveAllItems();
$this->lstParentAsset->AddItem(QApplication::Translate('- Select One -'), null);
$objParentAssetArray = Asset::LoadAll();
if ($objParentAssetArray) {
foreach ($objParentAssetArray as $objParentAsset) {
$objListItem = new QListItem($objParentAsset->__toString(), $objParentAsset->AssetId);
if ($this->objAsset->ParentAsset && $this->objAsset->ParentAsset->AssetId == $objParentAsset->AssetId) {
$objListItem->Selected = true;
}
$this->lstParentAsset->AddItem($objListItem);
}
}
}
if ($this->lblParentAssetId) {
$this->lblParentAssetId->Text = $this->objAsset->ParentAsset ? $this->objAsset->ParentAsset->__toString() : null;
}
if ($this->lstAssetModel) {
$this->lstAssetModel->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstAssetModel->AddItem(QApplication::Translate('- Select One -'), null);
}
$objAssetModelArray = AssetModel::LoadAll();
if ($objAssetModelArray) {
foreach ($objAssetModelArray as $objAssetModel) {
$objListItem = new QListItem($objAssetModel->__toString(), $objAssetModel->AssetModelId);
if ($this->objAsset->AssetModel && $this->objAsset->AssetModel->AssetModelId == $objAssetModel->AssetModelId) {
$objListItem->Selected = true;
}
$this->lstAssetModel->AddItem($objListItem);
}
}
}
if ($this->lblAssetModelId) {
$this->lblAssetModelId->Text = $this->objAsset->AssetModel ? $this->objAsset->AssetModel->__toString() : null;
}
if ($this->lstLocation) {
$this->lstLocation->RemoveAllItems();
$this->lstLocation->AddItem(QApplication::Translate('- Select One -'), null);
$objLocationArray = Location::LoadAll();
if ($objLocationArray) {
foreach ($objLocationArray as $objLocation) {
$objListItem = new QListItem($objLocation->__toString(), $objLocation->LocationId);
if ($this->objAsset->Location && $this->objAsset->Location->LocationId == $objLocation->LocationId) {
$objListItem->Selected = true;
}
$this->lstLocation->AddItem($objListItem);
}
}
}
if ($this->lblLocationId) {
$this->lblLocationId->Text = $this->objAsset->Location ? $this->objAsset->Location->__toString() : null;
}
if ($this->txtAssetCode) {
$this->txtAssetCode->Text = $this->objAsset->AssetCode;
}
if ($this->lblAssetCode) {
$this->lblAssetCode->Text = $this->objAsset->AssetCode;
}
if ($this->txtImagePath) {
$this->txtImagePath->Text = $this->objAsset->ImagePath;
}
if ($this->lblImagePath) {
$this->lblImagePath->Text = $this->objAsset->ImagePath;
}
if ($this->chkCheckedOutFlag) {
$this->chkCheckedOutFlag->Checked = $this->objAsset->CheckedOutFlag;
}
if ($this->lblCheckedOutFlag) {
$this->lblCheckedOutFlag->Text = $this->objAsset->CheckedOutFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->chkReservedFlag) {
$this->chkReservedFlag->Checked = $this->objAsset->ReservedFlag;
}
if ($this->lblReservedFlag) {
$this->lblReservedFlag->Text = $this->objAsset->ReservedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->chkLinkedFlag) {
$this->chkLinkedFlag->Checked = $this->objAsset->LinkedFlag;
}
if ($this->lblLinkedFlag) {
$this->lblLinkedFlag->Text = $this->objAsset->LinkedFlag ? QApplication::Translate('Yes') : QApplication::Translate('No');
}
if ($this->chkArchivedFlag) {
$this->chkArchivedFlag->Checked = $this->objAsset->ArchivedFlag;
//.........这里部分代码省略.........
示例5: Refresh
/**
* Refresh this MetaControl with Data from the local AssetTransaction object.
* @param boolean $blnReload reload AssetTransaction from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objAssetTransaction->Reload();
}
if ($this->lblAssetTransactionId) {
if ($this->blnEditMode) {
$this->lblAssetTransactionId->Text = $this->objAssetTransaction->AssetTransactionId;
}
}
if ($this->lstAsset) {
$this->lstAsset->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstAsset->AddItem(QApplication::Translate('- Select One -'), null);
}
$objAssetArray = Asset::LoadAll();
if ($objAssetArray) {
foreach ($objAssetArray as $objAsset) {
$objListItem = new QListItem($objAsset->__toString(), $objAsset->AssetId);
if ($this->objAssetTransaction->Asset && $this->objAssetTransaction->Asset->AssetId == $objAsset->AssetId) {
$objListItem->Selected = true;
}
$this->lstAsset->AddItem($objListItem);
}
}
}
if ($this->lblAssetId) {
$this->lblAssetId->Text = $this->objAssetTransaction->Asset ? $this->objAssetTransaction->Asset->__toString() : null;
}
if ($this->lstTransaction) {
$this->lstTransaction->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstTransaction->AddItem(QApplication::Translate('- Select One -'), null);
}
$objTransactionArray = Transaction::LoadAll();
if ($objTransactionArray) {
foreach ($objTransactionArray as $objTransaction) {
$objListItem = new QListItem($objTransaction->__toString(), $objTransaction->TransactionId);
if ($this->objAssetTransaction->Transaction && $this->objAssetTransaction->Transaction->TransactionId == $objTransaction->TransactionId) {
$objListItem->Selected = true;
}
$this->lstTransaction->AddItem($objListItem);
}
}
}
if ($this->lblTransactionId) {
$this->lblTransactionId->Text = $this->objAssetTransaction->Transaction ? $this->objAssetTransaction->Transaction->__toString() : null;
}
if ($this->lstParentAssetTransaction) {
$this->lstParentAssetTransaction->RemoveAllItems();
$this->lstParentAssetTransaction->AddItem(QApplication::Translate('- Select One -'), null);
$objParentAssetTransactionArray = AssetTransaction::LoadAll();
if ($objParentAssetTransactionArray) {
foreach ($objParentAssetTransactionArray as $objParentAssetTransaction) {
$objListItem = new QListItem($objParentAssetTransaction->__toString(), $objParentAssetTransaction->AssetTransactionId);
if ($this->objAssetTransaction->ParentAssetTransaction && $this->objAssetTransaction->ParentAssetTransaction->AssetTransactionId == $objParentAssetTransaction->AssetTransactionId) {
$objListItem->Selected = true;
}
$this->lstParentAssetTransaction->AddItem($objListItem);
}
}
}
if ($this->lblParentAssetTransactionId) {
$this->lblParentAssetTransactionId->Text = $this->objAssetTransaction->ParentAssetTransaction ? $this->objAssetTransaction->ParentAssetTransaction->__toString() : null;
}
if ($this->lstSourceLocation) {
$this->lstSourceLocation->RemoveAllItems();
$this->lstSourceLocation->AddItem(QApplication::Translate('- Select One -'), null);
$objSourceLocationArray = Location::LoadAll();
if ($objSourceLocationArray) {
foreach ($objSourceLocationArray as $objSourceLocation) {
$objListItem = new QListItem($objSourceLocation->__toString(), $objSourceLocation->LocationId);
if ($this->objAssetTransaction->SourceLocation && $this->objAssetTransaction->SourceLocation->LocationId == $objSourceLocation->LocationId) {
$objListItem->Selected = true;
}
$this->lstSourceLocation->AddItem($objListItem);
}
}
}
if ($this->lblSourceLocationId) {
$this->lblSourceLocationId->Text = $this->objAssetTransaction->SourceLocation ? $this->objAssetTransaction->SourceLocation->__toString() : null;
}
if ($this->lstDestinationLocation) {
$this->lstDestinationLocation->RemoveAllItems();
$this->lstDestinationLocation->AddItem(QApplication::Translate('- Select One -'), null);
$objDestinationLocationArray = Location::LoadAll();
if ($objDestinationLocationArray) {
foreach ($objDestinationLocationArray as $objDestinationLocation) {
$objListItem = new QListItem($objDestinationLocation->__toString(), $objDestinationLocation->LocationId);
if ($this->objAssetTransaction->DestinationLocation && $this->objAssetTransaction->DestinationLocation->LocationId == $objDestinationLocation->LocationId) {
$objListItem->Selected = true;
}
$this->lstDestinationLocation->AddItem($objListItem);
}
}
//.........这里部分代码省略.........
示例6: dtgAsset_Bind
public function dtgAsset_Bind()
{
// Get Total Count b/c of Pagination
$this->dtgAsset->TotalItemCount = Asset::CountAll();
$objClauses = array();
if ($objClause = $this->dtgAsset->OrderByClause) {
array_push($objClauses, $objClause);
}
if ($objClause = $this->dtgAsset->LimitClause) {
array_push($objClauses, $objClause);
}
$this->dtgAsset->DataSource = Asset::LoadAll($objClauses);
}
示例7: Refresh
/**
* Refresh this MetaControl with Data from the local AssetCustomFieldHelper object.
* @param boolean $blnReload reload AssetCustomFieldHelper from the database
* @return void
*/
public function Refresh($blnReload = false)
{
if ($blnReload) {
$this->objAssetCustomFieldHelper->Reload();
}
if ($this->lstAsset) {
$this->lstAsset->RemoveAllItems();
if (!$this->blnEditMode) {
$this->lstAsset->AddItem(QApplication::Translate('- Select One -'), null);
}
$objAssetArray = Asset::LoadAll();
if ($objAssetArray) {
foreach ($objAssetArray as $objAsset) {
$objListItem = new QListItem($objAsset->__toString(), $objAsset->AssetId);
if ($this->objAssetCustomFieldHelper->Asset && $this->objAssetCustomFieldHelper->Asset->AssetId == $objAsset->AssetId) {
$objListItem->Selected = true;
}
$this->lstAsset->AddItem($objListItem);
}
}
}
if ($this->lblAssetId) {
$this->lblAssetId->Text = $this->objAssetCustomFieldHelper->Asset ? $this->objAssetCustomFieldHelper->Asset->__toString() : null;
}
}