本文整理汇总了PHP中QQ::Clause方法的典型用法代码示例。如果您正苦于以下问题:PHP QQ::Clause方法的具体用法?PHP QQ::Clause怎么用?PHP QQ::Clause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQ
的用法示例。
在下文中一共展示了QQ::Clause方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __set
public function __set($strName, $mixValue)
{
switch ($strName) {
case "Expanded":
$this->blnExpanded = $mixValue;
if (!$this->blnDataBound) {
$this->blnDataBound = true;
// Get the class in question
$intClassId = $this->strItemId;
$objClass = QcodoClass::Load($intClassId);
// Bind Children
foreach ($objClass->Operations as $objOperation) {
new QTreeNavItem($objOperation->DisplayName, $intClassId . 'm' . $objOperation->Id, false, $this->objTreeNav->GetItem($intClassId . 'm'), $intClassId . 'm' . $objOperation->Id);
}
foreach ($objClass->GetPropertiesForVariableGroupId(null) as $objProperty) {
new QTreeNavItem($objProperty->DisplayName, $intClassId . 'p' . $objProperty->Id, false, $this->objTreeNav->GetItem($intClassId . 'p'), $intClassId . 'p' . $objProperty->Id);
}
foreach ($objClass->GetVariablesForVariableGroupId(null) as $objClassVariable) {
new QTreeNavItem($objClassVariable->DisplayName, $intClassId . 'v' . $objClassVariable->Id, false, $this->objTreeNav->GetItem($intClassId . 'v'), $intClassId . 'v' . $objClassVariable->Id);
}
foreach ($objClass->GetQcodoConstantArray(QQ::Clause(QQ::OrderBy(QQN::QcodoConstant()->Variable->Name))) as $objConstant) {
new QTreeNavItem($objConstant->Variable->Name, $intClassId . 'c' . $objConstant->Id, false, $this->objTreeNav->GetItem($intClassId . 'c'), $intClassId . 'c' . $objConstant->Id);
}
}
break;
default:
try {
return parent::__set($strName, $mixValue);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
}
}
示例2: Form_Create
protected function Form_Create()
{
// Define our Label
$this->lblMessage = new QLabel($this);
$this->lblMessage->Text = '<None>';
// Define the ListBox, and create the first listitem as 'Select One'
$this->lstPersons = new QListBox($this);
$this->lstPersons->AddItem('- Select One -', null);
// Add the items for the listbox, pulling in from the Person table
$objPersons = Person::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
if ($objPersons) {
foreach ($objPersons as $objPerson) {
// We want to display the listitem as Last Name, First Name
// and the VALUE of the listitem should be the person object itself
$this->lstPersons->AddItem($objPerson->LastName . ', ' . $objPerson->FirstName, $objPerson);
}
}
// Declare a QChangeEvent to call a server action: the lstPersons_Change PHP method
$this->lstPersons->AddAction(new QChangeEvent(), new QServerAction('lstPersons_Change'));
// Do the same but with a multiple selection QCheckboxList
$this->chkPersons = new QCheckBoxList($this);
if ($objPersons) {
foreach ($objPersons as $objPerson) {
// We want to display the listitem as Last Name, First Name
// and the VALUE of the listitem will be the database id
$this->chkPersons->AddItem($objPerson->FirstName . ' ' . $objPerson->LastName, $objPerson->Id);
}
}
$this->chkPersons->RepeatColumns = 2;
$this->chkPersons->AddAction(new QChangeEvent(), new QServerAction('chkPersons_Change'));
}
示例3: __construct
public function __construct(QPanel $pnlContent, $strReturnUrl)
{
$this->pnlContent = $pnlContent;
$this->pnlContent->Template = dirname(__FILE__) . '/EditGroupParticipationDelegate.tpl.php';
// Throw Exception if Group Cannot have Explicitly Defined Participants
if (!$this->pnlContent->objGroup->IsGroupCanHaveExplicitlyDefinedParticipants()) {
throw new Exception('Group Cannot have Explicitly Defined Participants');
}
$this->strReturnUrl = $strReturnUrl;
$this->objParticipationArray = GroupParticipation::LoadArrayByPersonIdGroupId($this->pnlContent->objPerson->Id, $this->pnlContent->objGroup->Id, QQ::OrderBy(QQN::GroupParticipation()->GroupRole->Name, QQN::GroupParticipation()->DateStart), QQ::Clause(QQ::Expand(QQN::GroupParticipation()->GroupRole)));
$this->chkIsAuthorizedSender = new QCheckBox($this->pnlContent);
$this->chkIsAuthorizedSender->Name = ' Is Authorized Sender';
if (GroupAuthorizedSender::LoadByGroupIdPersonId($this->pnlContent->objGroup->Id, $this->pnlContent->objPerson->Id)) {
$this->chkIsAuthorizedSender->Checked = true;
} else {
$this->chkIsAuthorizedSender->Checked = false;
}
$this->lblCurrentRoles = new QLabel($this->pnlContent);
$this->lblCurrentRoles->Name = 'Current Roles';
$this->lblCurrentRoles->HtmlEntities = false;
$this->lblCurrentRoles_Refresh();
$this->dtgParticipations = new QDataGrid($this->pnlContent);
$this->dtgParticipations->AddColumn(new QDataGridColumn('Role', '<?= $_CONTROL->ParentControl->objDelegate->RenderRole($_ITEM); ?>', 'HtmlEntities=false', 'Width=100px'));
$this->dtgParticipations->AddColumn(new QDataGridColumn('Participation Started', '<?= $_CONTROL->ParentControl->objDelegate->RenderDateStart($_ITEM); ?>', 'HtmlEntities=false', 'Width=150px'));
$this->dtgParticipations->AddColumn(new QDataGridColumn('Participation Ended', '<?= $_CONTROL->ParentControl->objDelegate->RenderDateEnd($_ITEM); ?>', 'HtmlEntities=false', 'Width=150px'));
$this->dtgParticipations->SetDataBinder('dtgParticipations_Bind', $this);
$this->pxyEdit = new QControlProxy($this->pnlContent);
$this->pxyEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this->pnlContent, 'pxyEdit_Click'));
$this->pxyEdit->AddAction(new QClickEvent(), new QTerminateAction());
$this->dlgEdit_Setup();
}
示例4: Form_Create
protected function Form_Create()
{
if (!QApplication::$Login) {
QApplication::Redirect('/');
}
$this->objVariable = ClassVariable::Load(QApplication::PathInfo(0));
if (!$this->objVariable) {
throw new Exception('Invalid Variable Id: ' . QApplication::PathInfo(0));
}
$this->lblClass = new QLabel($this);
$this->lblClass->Text = $this->objVariable->QcodoClass->Name;
$this->lblName = new QLabel($this);
$this->lblName->Text = $this->objVariable->Variable->Name;
$this->lstVariableGroup = new QListBox($this);
$this->lstVariableGroup->Name = 'Variable Group/Classification';
foreach (VariableGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::VariableGroup()->OrderNumber))) as $objVariableGroup) {
$this->lstVariableGroup->AddItem($objVariableGroup->Name, $objVariableGroup->Id, $objVariableGroup->Id == $this->objVariable->VariableGroupId);
}
$this->ctlVariable = new VariableControl($this, $this->objVariable->Variable, true, false);
$this->ctlVariable->Name = 'Variable Information';
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save';
$this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click'));
$this->btnSave->CausesValidation = true;
$this->btnCancel = new QButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click'));
$this->btnCancel->CausesValidation = false;
}
示例5: dtgItems_Bind
public function dtgItems_Bind()
{
$intYear = QApplication::PathInfo(0);
$dttStart = new QDateTime($intYear . '-01-01');
$dttEnd = new QDateTime($dttStart);
$dttEnd->Year += 1;
$dttStart->SetTime(null, null, null);
$dttEnd->SetTime(null, null, null);
$objPersonCursor = Person::QueryCursor(QQ::AndCondition(QQ::GreaterOrEqual(QQN::Person()->StewardshipContribution->DateCredited, $dttStart), QQ::LessThan(QQN::Person()->StewardshipContribution->DateCredited, $dttEnd)), QQ::Clause(QQ::Distinct(), QQ::OrderBy(QQN::Person()->LastName, QQN::Person()->FirstName)));
$strNameArray = array();
$strNameValueArray = array();
while ($objPerson = Person::InstantiateCursor($objPersonCursor)) {
$strToken = strtolower($objPerson->FirstName . '|' . $objPerson->LastName);
$strToken = str_replace(' ', '', $strToken);
$strToken = str_replace('.', '', $strToken);
$strToken = str_replace(',', '', $strToken);
$strToken = str_replace('-', '', $strToken);
$strToken = str_replace('_', '', $strToken);
$strToken = str_replace('/', '', $strToken);
if (array_key_exists($strToken, $strNameArray)) {
$strNameValueArray[$strToken] = $objPerson->FirstName . ' ' . $objPerson->LastName;
}
$strNameArray[$strToken] = true;
}
$this->dtgItems->DataSource = $strNameValueArray;
}
示例6: __construct
public function __construct(QcodoClass $objClass, $objParentControl, $strControlId = null)
{
parent::__construct($objParentControl, $strControlId);
$this->objQcodoClass = $objClass;
$this->strTemplate = 'ClassPanel.tpl.php';
$this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name;
$this->strShortDescriptionHtml = $this->objQcodoClass->ShortDescriptionAsHtml;
if (!$this->strShortDescriptionHtml) {
$this->strShortDescriptionHtml = '<span style="color: #888888;"><i>No description entered yet.</i></span>';
}
$this->strLongDescriptionHtml = QWriteBox::DisplayHtml($this->objQcodoClass->ExtendedDescription, 'writebox_code');
$this->strVersion = 'Qcodo >= ' . $this->objQcodoClass->FirstVersion;
if ($this->objQcodoClass->LastVersion) {
$this->strVersion .= ' - Deprecated as of ' . $this->objQcodoClass->LastVersion;
}
$this->strParentClassArray[$objClass->Id] = $objClass->DisplayName;
$objParentClass = $objClass->ParentQcodoClass;
while ($objParentClass) {
$this->strParentClassArray[$objParentClass->Id] = $objParentClass->DisplayName;
$objParentClass = $objParentClass->ParentQcodoClass;
}
$this->strParentClassArray = array_reverse($this->strParentClassArray, true);
foreach ($this->objQcodoClass->GetChildQcodoClassArray(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objChildClass) {
$this->strChildClassArray[$objChildClass->Id] = $objChildClass->DisplayName;
}
if (QApplication::$Login) {
$this->strEditLink = '<div class="edit_link" title="Edit" onclick="document.location=\'/edit_class.php/';
$this->strEditLink .= $this->objQcodoClass->Id;
$this->strEditLink .= '\'">EDIT</div>';
}
}
示例7: testMultiLevel
public function testMultiLevel()
{
$arrPeople = Person::LoadAll(QQ::Clause(QQ::ExpandAsArray(QQN::Person()->Address), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager->Milestone)));
$targetPerson = null;
foreach ($arrPeople as $objPerson) {
if ($objPerson->LastName == "Wolfe") {
$targetPerson = $objPerson;
}
}
$this->assertEqual(sizeof($arrPeople), 12);
$this->assertNotEqual($targetPerson, null, "Karen Wolfe found");
$targetProject = null;
foreach ($targetPerson->_ProjectAsManagerArray as $objProject) {
if ($objProject->Name == "ACME Payment System") {
$targetProject = $objProject;
}
}
$this->assertEqual(sizeof($targetPerson->_ProjectAsManagerArray), 2, "2 projects found");
$this->assertNotEqual($targetProject, null, "ACME Payment System project found");
$targetMilestone = null;
foreach ($targetProject->_MilestoneArray as $objMilestone) {
if ($objMilestone->Name == "Milestone H") {
$targetMilestone = $objMilestone;
}
}
$this->assertEqual(sizeof($targetProject->_MilestoneArray), 4, "4 milestones found");
$this->assertNotEqual($targetMilestone, null, "Milestone H found");
}
示例8: Form_Create
protected function Form_Create()
{
if (!QApplication::$Login) {
QApplication::Redirect('/');
}
$this->objQcodoClass = QcodoClass::Load(QApplication::PathInfo(0));
if (!$this->objQcodoClass) {
throw new Exception('Invalid QcodoClass Id: ' . QApplication::PathInfo(0));
}
$this->lblName = new QLabel($this);
$this->lblName->Text = $this->objQcodoClass->Name;
$this->lstClassGroup = new QListBox($this);
$this->lstClassGroup->Name = 'Class Group/Classification';
foreach (ClassGroup::LoadAll(QQ::Clause(QQ::OrderBy(QQN::ClassGroup()->OrderNumber))) as $objClassGroup) {
$this->lstClassGroup->AddItem($objClassGroup->Name, $objClassGroup->Id, $objClassGroup->Id == $this->objQcodoClass->ClassGroupId);
}
$this->chkEnumerationFlag = new QCheckBox($this);
$this->chkEnumerationFlag->Checked = $this->objQcodoClass->EnumerationFlag;
$this->chkEnumerationFlag->Name = 'Enumeration Class Flag';
$this->txtShortDescription = new QTextBox($this);
$this->txtShortDescription->Name = QApplication::Translate('Short Description');
$this->txtShortDescription->Text = $this->objQcodoClass->ShortDescription;
$this->txtShortDescription->TextMode = QTextMode::MultiLine;
$this->txtExtendedDescription = new QWriteBox($this);
$this->txtExtendedDescription->Name = QApplication::Translate('Extended Description');
$this->txtExtendedDescription->Text = $this->objQcodoClass->ExtendedDescription;
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save';
$this->btnSave->AddAction(new QClickEvent(), new QServerAction('btnSave_Click'));
$this->btnSave->CausesValidation = true;
$this->btnCancel = new QButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QServerAction('btnCancel_Click'));
$this->btnCancel->CausesValidation = false;
}
示例9: testSelectSubsetInExpandAsArray
public function testSelectSubsetInExpandAsArray()
{
$objPersonArray = Person::LoadAll(QQ::Clause(QQ::Select(QQN::Person()->FirstName), QQ::ExpandAsArray(QQN::Person()->Address, QQ::Select(QQN::Person()->Address->Street, QQN::Person()->Address->City)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager, QQ::Select(QQN::Person()->ProjectAsManager->StartDate)), QQ::ExpandAsArray(QQN::Person()->ProjectAsManager->Milestone, QQ::Select(QQN::Person()->ProjectAsManager->Milestone->Name))));
foreach ($objPersonArray as $objPerson) {
$this->assertNull($objPerson->LastName, "LastName should be null, since it was not selected");
$this->assertNotNull($objPerson->Id, "Id should not be null since it's always added to the select list");
if (sizeof($objPerson->_AddressArray) > 0) {
foreach ($objPerson->_AddressArray as $objAddress) {
$this->assertNotNull($objAddress->Id, "Address->Id should not be null since it's always added to the select list");
$this->assertNull($objAddress->PersonId, "Address->PersonId should be null, since it was not selected");
}
}
if (sizeof($objPerson->_ProjectAsManagerArray) > 0) {
foreach ($objPerson->_ProjectAsManagerArray as $objProject) {
$this->assertNotNull($objProject->Id, "Project->Id should not be null since it's always added to the select list");
$this->assertNull($objProject->Name, "Project->Name should be null, since it was not selected");
if (sizeof($objProject->_MilestoneArray) > 0) {
foreach ($objProject->_MilestoneArray as $objMilestone) {
$this->assertNotNull($objMilestone->Id, "Milestone->Id should not be null since it's always added to the select list");
$this->assertNull($objMilestone->ProjectId, "Milestone->ProjectId should be null, since it was not selected");
}
}
}
}
}
}
示例10: __construct
public function __construct($objParentObject, $objVariableOrParameter, $blnDefaultValueEditable, $blnShowExtendedDescription, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
if ($objVariableOrParameter instanceof Parameter) {
$this->objParameter = $objVariableOrParameter;
$this->objVariable = $this->objParameter->Variable;
$blnShowReference = true;
} else {
$this->objVariable = $objVariableOrParameter;
$blnShowReference = false;
}
// Setup Local Variables
$this->strName = $this->objVariable->Name;
// Next, we'll create our local subcontrols. Make sure to set "this" as these subcontrols' parent.
$this->lstVariableType = new QListBox($this);
$this->lstVariableType->Name = $this->strName . ' Variable Type';
$this->lstVariableType->CssClass .= ' vctl';
foreach (VariableType::$NameArray as $intId => $strName) {
$this->lstVariableType->AddItem($strName, $intId, $this->objVariable->VariableTypeId == $intId);
}
$this->lstObjectType = new QListBox($this);
$this->lstObjectType->Name = 'Object Type';
$this->lstObjectType->AddItem('- Unspecified -', null);
$this->lstObjectType->CssClass .= ' vctl';
foreach (QcodoClass::LoadAll(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objQcodoClass) {
$this->lstObjectType->AddItem($objQcodoClass->Name, $objQcodoClass->Id, $this->objVariable->ObjectTypeId == $objQcodoClass->Id);
}
$this->chkArray = new QCheckBox($this);
$this->chkArray->Name = $this->strName . ' is an Array?';
$this->chkArray->Checked = $this->objVariable->ArrayFlag;
$this->chkReference = new QCheckBox($this);
$this->chkReference->Visible = $blnShowReference;
if ($this->objParameter) {
$this->chkReference->Checked = $this->objParameter->ReferenceFlag;
}
$this->txtDefaultValue = new QTextBox($this);
$this->txtDefaultValue->Name = $this->strName . ' Default Value';
$this->txtDefaultValue->Text = $this->objVariable->DefaultValue;
$this->txtDefaultValue->Enabled = $blnDefaultValueEditable;
$this->txtDefaultValue->CssClass .= ' vctl';
$this->txtShortDescription = new QTextBox($this);
$this->txtShortDescription->Name = $this->strName . ' Short Description';
$this->txtShortDescription->Text = $this->objVariable->ShortDescription;
$this->txtShortDescription->TextMode = QTextMode::MultiLine;
$this->txtShortDescription->CssClass = 'textbox_multiline';
$this->txtExtendedDescription = new QWriteBox($this);
$this->txtExtendedDescription->Name = $this->strName . ' Extended Description';
$this->txtExtendedDescription->Text = $this->objVariable->ExtendedDescription;
$this->txtExtendedDescription->CssClass = 'textbox_multiline';
$this->txtExtendedDescription->Visible = $blnShowExtendedDescription;
$this->lstVariableType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstVariableType_Change'));
$this->lstVariableType_Change();
}
示例11: LoadWpPosts
/**
* @return WpPosts|null The WpPosts object, that is a copy of this DLE post.
*/
public function LoadWpPosts()
{
$objWpUsers = $this->LoadWpUser();
if (!$objWpUsers) {
return null;
}
return WpPosts::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::WpPosts()->PostAuthor, $objWpUsers->Id), QQ::Equal(QQN::WpPosts()->PostDate, $this->Date), QQ::Equal(QQN::WpPosts()->PostName, $this->AltName)), QQ::Clause(QQ::LimitInfo(1)));
}
示例12: dtgPersons_Bind
protected function dtgPersons_Bind()
{
// We must first let the datagrid know how many total items there are
$this->dtgPersons->TotalItemCount = Person::CountAll();
// Next, we must be sure to load the data source, passing in the datagrid's
// limit info into our loadall method.
$this->dtgPersons->DataSource = Person::LoadAll(QQ::Clause($this->dtgPersons->OrderByClause, $this->dtgPersons->LimitClause));
}
示例13: dtgProjects_Bind
protected function dtgProjects_Bind()
{
// We must first let the datagrid know how many total items there are
$this->dtgProjects->TotalItemCount = Project::QueryCount($this->dtgProjects->Conditions);
// Next, we must be sure to load the data source, passing in the datagrid's
// limit info into our loadall method.
$this->dtgProjects->DataSource = Project::QueryArray($this->dtgProjects->Conditions, QQ::Clause($this->dtgProjects->OrderByClause, $this->dtgProjects->LimitClause));
}
示例14: dtgGroupRegistration_Bind
protected function dtgGroupRegistration_Bind()
{
$objConditions = QQ::All();
$objClauses = QQ::Clause($this->dtgGroupRegistrations->OrderByClause);
if (!$this->chkShowInactive->Checked) {
$objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::GroupRegistrations()->ProcessedFlag, false), QQ::IsNull(QQN::GroupRegistrations()->ProcessedFlag)));
}
$this->dtgGroupRegistrations->DataSource = GroupRegistrations::QueryArray($objConditions, $objClauses);
}
示例15: __construct
public function __construct(QcodoClass $objQcodoClass, $objParentControl, $strControlId = null)
{
parent::__construct($objParentControl, $strControlId);
// We're looking at ALL Methods/Operations
$this->objQcodoClass = $objQcodoClass;
$this->strUrl = 'http://' . $_SERVER['HTTP_HOST'] . '/index.php/' . $this->objQcodoClass->Name . '/Constants';
$this->strTemplate = 'ConstantPanel.tpl.php';
$this->objConstantArray = $this->objQcodoClass->GetQcodoConstantArray(QQ::Clause(QQ::OrderBy(QQN::QcodoConstant()->Variable->Name), QQ::Expand(QQN::QcodoConstant()->Variable)));
}