本文整理汇总了PHP中Contact::LoadArrayByCompanyId方法的典型用法代码示例。如果您正苦于以下问题:PHP Contact::LoadArrayByCompanyId方法的具体用法?PHP Contact::LoadArrayByCompanyId怎么用?PHP Contact::LoadArrayByCompanyId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contact
的用法示例。
在下文中一共展示了Contact::LoadArrayByCompanyId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lstFromCompany_Select
protected function lstFromCompany_Select()
{
// Clear any displayed warnings
$this->lblNewFromContact->Warning = '';
if ($this->lstFromCompany->SelectedValue) {
$objCompany = Company::Load($this->lstFromCompany->SelectedValue);
if ($objCompany) {
// Load the values for the 'From Contact' List
if ($this->lstFromContact) {
$objFromContactArray = Contact::LoadArrayByCompanyId($objCompany->CompanyId);
if ($this->lstFromContact->SelectedValue) {
$SelectedContactId = $this->lstFromContact->SelectedValue;
} elseif ($this->objReceipt->FromContactId) {
$SelectedContactId = $this->objReceipt->FromContactId;
} else {
$SelectedContactId = null;
}
$this->lstFromContact->RemoveAllItems();
$this->lstFromContact->AddItem('- Select One -', null);
if ($objFromContactArray) {
foreach ($objFromContactArray as $objFromContact) {
$objListItem = new QListItem($objFromContact->__toString(), $objFromContact->ContactId);
if ($SelectedContactId == $objFromContact->ContactId) {
$objListItem->Selected = true;
}
$this->lstFromContact->AddItem($objListItem);
}
}
$this->lstFromContact->Enabled = true;
}
}
}
}
示例2: Form_PreRender
protected function Form_PreRender()
{
$this->dtgContact->TotalItemCount = Contact::CountByCompanyId($this->objCompany->CompanyId);
if ($this->dtgContact->TotalItemCount == 0) {
$this->dtgContact->ShowHeader = false;
} else {
$objClauses = array();
if ($objClause = $this->dtgContact->OrderByClause) {
array_push($objClauses, $objClause);
}
if ($objClause = $this->dtgContact->LimitClause) {
array_push($objClauses, $objClause);
}
$this->dtgContact->DataSource = Contact::LoadArrayByCompanyId($this->objCompany->CompanyId, $objClauses);
$this->dtgContact->ShowHeader = true;
}
$this->dtgAddress->TotalItemCount = Address::CountByCompanyId($this->objCompany->CompanyId);
if ($this->dtgAddress->TotalItemCount == 0) {
$this->dtgAddress->ShowHeader = false;
} else {
$objClauses = array();
if ($objClause = $this->dtgAddress->OrderByClause) {
array_push($objClauses, $objClause);
}
if ($objClause = $this->dtgAddress->LimitClause) {
array_push($objClauses, $objClause);
}
$this->dtgAddress->DataSource = Address::LoadArrayByCompanyId($this->objCompany->CompanyId, $objClauses);
$this->dtgAddress->ShowHeader = true;
}
// Do not show the datagrids or 'Create New' buttons if creating a new company
if (!$this->blnEditMode) {
$this->btnCreateContact->Visible = false;
$this->dtgContact->Visible = false;
$this->btnCreateAddress->Visible = false;
$this->dtgAddress->Visible = false;
}
}
示例3: lstToCompany_Select
public function lstToCompany_Select()
{
if ($this->pnlShipmentMassEdit->lstToCompany->SelectedValue) {
$objCompany = Company::Load($this->pnlShipmentMassEdit->lstToCompany->SelectedValue);
if ($objCompany) {
// Load the values for the 'To Contact' List
if ($this->pnlShipmentMassEdit->lstToContact) {
$objToContactArray = Contact::LoadArrayByCompanyId($objCompany->CompanyId, QQ::Clause(QQ::OrderBy(QQN::Contact()->LastName, QQN::Contact()->FirstName)));
$this->pnlShipmentMassEdit->lstToContact->RemoveAllItems();
if ($objToContactArray) {
foreach ($objToContactArray as $objToContact) {
$objListItem = new QListItem($objToContact->__toString(), $objToContact->ContactId);
$this->pnlShipmentMassEdit->lstToContact->AddItem($objListItem);
}
$this->pnlShipmentMassEdit->lstToContact->Enabled = true;
}
}
// Load the values for the 'To Address' List
if ($this->pnlShipmentMassEdit->lstToAddress) {
$objToAddressArray = Address::LoadArrayByCompanyId($objCompany->CompanyId, QQ::Clause(QQ::OrderBy(QQN::Address()->ShortDescription)));
$this->pnlShipmentMassEdit->lstToAddress->RemoveAllItems();
if ($objToAddressArray) {
foreach ($objToAddressArray as $objToAddress) {
$objListItem = new QListItem($objToAddress->__toString(), $objToAddress->AddressId);
$this->pnlShipmentMassEdit->lstToAddress->AddItem($objListItem);
}
$this->pnlShipmentMassEdit->lstToAddress->Enabled = true;
//$this->lstToAddress_Select();
}
}
}
}
}
示例4: lstToCompany_Select
public function lstToCompany_Select()
{
if ($this->lstToCompany->SelectedValue) {
$objCompany = Company::Load($this->lstToCompany->SelectedValue);
if ($objCompany) {
// Load the values for the 'To Contact' List
if ($this->lstToContact) {
$objToContactArray = Contact::LoadArrayByCompanyId($objCompany->CompanyId, QQ::Clause(QQ::OrderBy(QQN::Contact()->LastName, QQN::Contact()->FirstName)));
$this->lstToContact->RemoveAllItems();
$this->lstToContact->AddItem('- Select One -', null);
if ($objToContactArray) {
foreach ($objToContactArray as $objToContact) {
$objListItem = new QListItem($objToContact->__toString(), $objToContact->ContactId);
$this->lstToContact->AddItem($objListItem);
}
$this->lstToContact->Enabled = true;
}
}
}
} else {
$this->lstToContact->Enabled = false;
$this->lstToContact->RemoveAllItems();
$this->lstToContact->AddItem('- Select One -', null);
}
}
示例5: lstToCompany_Select
protected function lstToCompany_Select()
{
$this->disableAdvancedIfInternal();
// Clear any displayed warnings
if ($this->lblNewToContact) {
$this->lblNewToContact->Warning = '';
$this->lblNewToAddress->Warning = '';
}
if ($this->lstToCompany->SelectedValue) {
$objCompany = Company::Load($this->lstToCompany->SelectedValue);
if ($objCompany) {
// Load the values for the 'To Contact' List
if ($this->lstToContact) {
$objToContactArray = Contact::LoadArrayByCompanyId($objCompany->CompanyId, QQ::Clause(QQ::OrderBy(QQN::Contact()->LastName, QQN::Contact()->FirstName)));
if ($this->lstToContact->SelectedValue) {
$SelectedContactId = $this->lstToContact->SelectedValue;
} elseif ($this->objShipment->ToContactId) {
$SelectedContactId = $this->objShipment->ToContactId;
} else {
$SelectedContactId = null;
}
$this->lstToContact->RemoveAllItems();
$this->lstToContact->AddItem('- Select One -', null);
if ($objToContactArray) {
foreach ($objToContactArray as $objToContact) {
$objListItem = new QListItem($objToContact->__toString(), $objToContact->ContactId);
if ($SelectedContactId == $objToContact->ContactId) {
$objListItem->Selected = true;
}
$this->lstToContact->AddItem($objListItem);
}
$this->lstToContact->Enabled = true;
}
}
// Load the values for the 'To Address' List
if ($this->lstToAddress) {
$objToAddressArray = Address::LoadArrayByCompanyId($objCompany->CompanyId, QQ::Clause(QQ::OrderBy(QQN::Address()->ShortDescription)));
if ($this->lstToAddress->SelectedValue) {
$SelectedAddressId = $this->lstToAddress->SelectedValue;
} elseif ($this->objShipment->ToAddressId) {
$SelectedAddressId = $this->objShipment->ToAddressId;
} else {
$SelectedAddressId = null;
}
$this->lstToAddress->RemoveAllItems();
$this->lstToAddress->AddItem('- Select One -', null);
if ($objToAddressArray) {
foreach ($objToAddressArray as $objToAddress) {
$objListItem = new QListItem($objToAddress->__toString(), $objToAddress->AddressId);
if ($SelectedAddressId == $objToAddress->AddressId) {
$objListItem->Selected = true;
}
$this->lstToAddress->AddItem($objListItem);
}
$this->lstToAddress->Enabled = true;
$this->lstToAddress_Select();
}
}
}
}
}
示例6: DeleteAllContacts
/**
* Deletes all associated Contacts
* @return void
*/
public function DeleteAllContacts()
{
if (is_null($this->intCompanyId)) {
throw new QUndefinedPrimaryKeyException('Unable to call UnassociateContact on this unsaved Company.');
}
// Get the Database Object for this Class
$objDatabase = Company::GetDatabase();
// Journaling
if ($objDatabase->JournalingDatabase) {
foreach (Contact::LoadArrayByCompanyId($this->intCompanyId) as $objContact) {
$objContact->Journal('DELETE');
}
}
// Perform the SQL Query
$objDatabase->NonQuery('
DELETE FROM
`contact`
WHERE
`company_id` = ' . $objDatabase->SqlVariable($this->intCompanyId) . '
');
}
示例7: GetContactArray
/**
* Gets all associated Contacts as an array of Contact objects
* @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
* @return Contact[]
*/
public function GetContactArray($objOptionalClauses = null)
{
if (is_null($this->intCompanyId)) {
return array();
}
try {
return Contact::LoadArrayByCompanyId($this->intCompanyId, $objOptionalClauses);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
示例8: lstToCompany_Select
public function lstToCompany_Select()
{
if ($this->lstToCompany->SelectedValue) {
$objCompany = Company::Load($this->lstToCompany->SelectedValue);
if ($objCompany) {
// Load the values for the 'To Contact' List
if ($this->lstToContact) {
$objToContactArray = Contact::LoadArrayByCompanyId($objCompany->CompanyId, QQ::Clause(QQ::OrderBy(QQN::Contact()->LastName, QQN::Contact()->FirstName)));
$this->lstToContact->RemoveAllItems();
$this->lstToContact->AddItem('Any', 'any_' . $objCompany->CompanyId);
if ($objToContactArray) {
foreach ($objToContactArray as $objToContact) {
$objListItem = new QListItem($objToContact->__toString(), $objToContact->ContactId);
$this->lstToContact->AddItem($objListItem);
}
//$this->lstToContact->Enabled = true;
}
// For companies that have no contacts
// Removed because SQL-query causes no errors
/*else {
$this->lstToContact->RemoveAllItems();
$this->lstToContact->AddItem('- Select One -', null);
}*/
}
}
} else {
//$this->lstToContact->Enabled = false;
$this->lstToContact->RemoveAllItems();
$this->lstToContact->AddItem('- Select One -', null);
$this->lstToContact->AddItem('Any', 'any');
}
}