本文整理汇总了PHP中QQ::AndCondition方法的典型用法代码示例。如果您正苦于以下问题:PHP QQ::AndCondition方法的具体用法?PHP QQ::AndCondition怎么用?PHP QQ::AndCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQ
的用法示例。
在下文中一共展示了QQ::AndCondition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Form_Create
protected function Form_Create()
{
$this->mctObject = ClassInstructorMetaControl::CreateFromPathInfo($this, QMetaControlCreateType::CreateOnRecordNotFound);
if ($this->mctObject->EditMode) {
$this->strPageTitle .= 'Edit Instructor';
} else {
$this->strPageTitle .= 'Create New Instructor';
}
$this->lstLogin = $this->mctObject->lstLogin_Create(null, QQ::OrCondition(QQ::AndCondition(QQ::IsNull(QQN::Login()->ClassInstructor->Id), QQ::Equal(QQN::Login()->LoginActiveFlag, true), QQ::Equal(QQN::Login()->DomainActiveFlag, true)), QQ::Equal(QQN::Login()->Id, $this->mctObject->ClassInstructor->LoginId)), QQ::OrderBy(QQN::Login()->FirstName, QQN::Login()->LastName));
$this->txtDisplayName = $this->mctObject->txtDisplayName_Create();
$this->txtDisplayName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$this->btnSave = new QButton($this);
$this->btnSave->CssClass = 'primary';
$this->btnSave->Text = $this->mctObject->EditMode ? 'Update' : 'Create';
$this->btnSave->CausesValidation = true;
$this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
$this->btnSave->AddAction(new QClickEvent(), new QTerminateAction());
$this->btnCancel = new QLinkButton($this);
$this->btnCancel->CssClass = 'cancel';
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
$this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
if ($this->mctObject->EditMode) {
$this->btnDelete = new QLinkButton($this);
$this->btnDelete->CssClass = 'delete';
$this->btnDelete->Text = 'Delete';
$this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to PERMANENTLY DELETE this?'));
$this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
$this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
}
}
示例2: RestoreByNameForClass
public static function RestoreByNameForClass($strName, $intClassId, $strVersion, $objFile)
{
$objOperation = Operation::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::Operation()->QcodoClassId, $intClassId), QQ::Equal(QQN::Operation()->Name, $strName)));
if (!$objOperation) {
$objOperation = new Operation();
$objOperation->Name = $strName;
$objOperation->QcodoClassId = $intClassId;
$objOperation->FirstVersion = $strVersion;
$objOperation->File = $objFile;
$objOperation->Save();
} else {
$blnSave = false;
if ($objOperation->LastVersion) {
$objOperation->LastVersion = null;
$blnSave = true;
}
if ($objFile->Id != $objOperation->intFileId) {
$objOperation->File = $objFile;
$blnSave = true;
}
if ($blnSave) {
$objOperation->Save();
}
}
return $objOperation;
}
示例3: Save
public function Save($blnForceInsert = false, $blnForceUpdate = false)
{
$this->intSuggestionWordCount = NarroString::WordCount($this->strSuggestionValue);
$this->intSuggestionCharCount = mb_strlen($this->strSuggestionValue);
$this->strSuggestionValueMd5 = md5($this->strSuggestionValue);
if (!isset($this->blnIsImported)) {
$this->blnIsImported = false;
}
if (!$this->__blnRestored || $blnForceInsert) {
$this->dttCreated = QDateTime::Now();
} else {
$this->dttModified = QDateTime::Now();
}
parent::Save($blnForceInsert, $blnForceUpdate);
/**
* Update all context infos with the has suggestion property
*/
$arrContextInfo = NarroContextInfo::QueryArray(QQ::AndCondition(QQ::Equal(QQN::NarroContextInfo()->Context->TextId, $this->intTextId), QQ::Equal(QQN::NarroContextInfo()->LanguageId, $this->intLanguageId), QQ::Equal(QQN::NarroContextInfo()->HasSuggestions, 0)));
foreach ($arrContextInfo as $objOneContextInfo) {
$objOneContextInfo->HasSuggestions = 1;
$objOneContextInfo->Modified = QDateTime::Now();
try {
$objOneContextInfo->Save();
} catch (Exception $objEx) {
NarroLogger::LogWarn($objEx->getMessage());
}
}
}
示例4: CreateGroupParticipations
function CreateGroupParticipations(mysqli $objAcsDatabase, Group $objGroup, GroupRole $objRole, $intAcsGroupId, $intAcsReserveId)
{
print "Adding for Group: " . $objGroup->Name . "\r\n ";
if ($intAcsReserveId) {
$objResult = $objAcsDatabase->query(sprintf('select * from awgrrost where groupid=%s AND reserveid1=%s', $intAcsGroupId, $intAcsReserveId));
} else {
$objResult = $objAcsDatabase->query(sprintf('select * from awgrrost where groupid=%s', $intAcsGroupId));
}
while ($objRow = $objResult->fetch_array()) {
$objAttributeValueArray = AttributeValue::QueryArray(QQ::AndCondition(QQ::Equal(QQN::AttributeValue()->AttributeId, 2), QQ::Equal(QQN::AttributeValue()->TextValue, $objRow['indvid'])));
if (count($objAttributeValueArray) != 1) {
printf("Issue with awgrrost.pkid of %s - IndvId %s for Group %s - AVCount of %s\r\n", $objRow['pkid'], $objRow['indvid'], $objGroup->Name, count($objAttributeValueArray));
} else {
$objPerson = $objAttributeValueArray[0]->Person;
$dttStartDate = new QDateTime($objRow['dateadded']);
if ($objRow['dateremoved']) {
$dttEndDate = new QDateTime($objRow['dateremoved']);
} else {
$dttEndDate = null;
}
$objGroup->AddPerson($objPerson, $objRole->Id, $dttStartDate, $dttEndDate);
print "*";
}
}
print "\r\n Done.\r\n\r\n";
}
示例5: process_object
/**
* @param DleCategory $objDleCategory The DB ORM object to process
*/
protected function process_object($objDleCategory)
{
// wp: term_taxonomy_id, term_id, description, parent
// dl: id, id, descr, parentid
$wpTerms = $objDleCategory->LoadWpTerms();
if (!$wpTerms) {
throw QCallerException(QApplication::Translate("Failed to find the WpTerm object for DleCategory."));
}
$wpTermsParent = null;
if ($objDleCategory->ParentidObject) {
$wpTermsParent = $objDleCategory->ParentidObject->LoadWpTerms();
}
$intWpTermsParentId = 0;
if ($wpTermsParent) {
$intWpTermsParentId = $wpTermsParent->TermId;
}
// check if already copied
if (!WpTermTaxonomy::QueryCount(QQ::AndCondition(QQ::Equal(QQN::WpTermTaxonomy()->TermId, $wpTerms->TermId), QQ::Equal(QQN::WpTermTaxonomy()->Parent, $intWpTermsParentId)))) {
$objWpTermTaxonomy = new WpTermTaxonomy();
$objWpTermTaxonomy->Initialize();
// set defaults
$objWpTermTaxonomy->TermId = $wpTerms->TermId;
$objWpTermTaxonomy->Description = $objDleCategory->Descr;
$objWpTermTaxonomy->Parent = $intWpTermsParentId;
$objWpTermTaxonomy->Taxonomy = "category";
$objWpTermTaxonomy->Count = 0;
$objWpTermTaxonomy->Save();
$this->intTermTaxonomyCount++;
}
}
示例6: dtgWikiItems_Bind
public function dtgWikiItems_Bind()
{
$objCondition = QQ::All();
if (trim($this->txtTitle->Text)) {
$objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->CurrentName, '%' . trim($this->txtTitle->Text) . '%'));
}
if ($strPath = trim($this->txtPath->Text)) {
$strPath = WikiItem::SanitizeForPath($strPath, $intWikiItemTypeId);
$objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->Path, $strPath . '%'));
}
if ($intValue = $this->lstWikiItemType->SelectedValue) {
$objCondition = QQ::AndCondition($objCondition, QQ::Equal(QQN::WikiItem()->WikiItemTypeId, $intValue));
}
if (trim($this->txtPostedBy->Text)) {
$objCondition = QQ::AndCondition($objCondition, QQ::Like(QQN::WikiItem()->CurrentPostedByPerson->DisplayName, trim($this->txtPostedBy->Text) . '%'));
}
$this->dtgWikiItems->TotalItemCount = WikiItem::QueryCount($objCondition);
$objClauses = array();
if ($objClause = $this->dtgWikiItems->LimitClause) {
$objClauses[] = $objClause;
}
if ($objClause = $this->dtgWikiItems->OrderByClause) {
$objClauses[] = $objClause;
}
$this->dtgWikiItems->DataSource = WikiItem::QueryArray($objCondition, $objClauses);
}
示例7: chkPermission_Click
public function chkPermission_Click($strFormId, $strControlId, $strParameter)
{
if (is_numeric($strParameter)) {
$chkPermission = $this->Form->GetControl($strControlId);
if ($chkPermission->Checked) {
$objRolePermission = new NarroRolePermission();
$objRolePermission->RoleId = $this->objRole->RoleId;
$objRolePermission->PermissionId = $strParameter;
try {
$objRolePermission->Save();
} catch (QMySqliDatabaseException $objExc) {
if (strpos($objExc->getMessage(), 'Duplicate entry') === false) {
throw $objExc;
} else {
//
}
}
} else {
$objRolePermission = NarroRolePermission::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::NarroRolePermission()->RoleId, $this->objRole->RoleId), QQ::Equal(QQN::NarroRolePermission()->PermissionId, $strParameter)));
if ($objRolePermission instanceof NarroRolePermission) {
$objRolePermission->Delete();
}
}
} else {
$this->dtgPermission_Bind();
}
}
示例8: dtgStaff_Bind
public function dtgStaff_Bind()
{
$objConditions = QQ::All();
if ($this->lstMinistry->SelectedValue) {
$objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->Ministry->MinistryId, $this->lstMinistry->SelectedValue));
}
if ($this->lstActiveFlag->SelectedValue) {
$objConditions = QQ::AndCondition($objConditions, QQ::Equal(QQN::Login()->DomainActiveFlag, true), QQ::Equal(QQN::Login()->LoginActiveFlag, true));
} else {
$objConditions = QQ::AndCondition($objConditions, QQ::OrCondition(QQ::Equal(QQN::Login()->DomainActiveFlag, false), QQ::Equal(QQN::Login()->LoginActiveFlag, false)));
}
$this->dtgStaff->TotalItemCount = Login::QueryCount($objConditions);
// 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->dtgStaff->OrderByClause) {
array_push($objClauses, $objClause);
}
// Add the LimitClause information, as well
if ($objClause = $this->dtgStaff->LimitClause) {
array_push($objClauses, $objClause);
}
// Set the DataSource to be a Query result from Login, given the clauses above
$this->dtgStaff->DataSource = Login::QueryArray($objConditions, $objClauses);
}
示例9: GetControlHtml
public function GetControlHtml()
{
$strLogContents = '';
foreach (NarroLog::QueryArray(QQ::AndCondition(QQ::Equal(QQN::NarroLog()->ProjectId, $this->intProjectId), QQ::Equal(QQN::NarroLog()->LanguageId, $this->intLanguageId), QQ::GreaterThan(QQN::NarroLog()->Date, $this->dttStart))) as $objLogEntry) {
switch ($objLogEntry->Priority) {
case NarroLog::PRIORITY_INFO:
$strLogContents .= '<div class="info"';
break;
case NarroLog::PRIORITY_WARN:
$strLogContents .= '<div class="warning"';
break;
case NarroLog::PRIORITY_ERROR:
$strLogContents .= '<div class="error"';
break;
default:
$strLogContents .= '<div';
}
$strLogContents .= sprintf('title="%s">%s</div>', $objLogEntry->Date, nl2br(NarroString::HtmlEntities($objLogEntry->Message)));
}
$this->strText = sprintf('<div class="ui-accordion ui-widget ui-helper-reset ui-accordion-icons">
<h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-state-active ui-corner-top">
<span class="ui-icon ui-icon-triangle-1-s"></span>
<a>%s</a>
</h3>
<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active" style="max-height:300px;overflow:auto">
%s
</div>
</div>', t('Operation log'), $strLogContents);
return parent::GetControlHtml();
}
示例10: RestoreByNameForClass
public static function RestoreByNameForClass($strName, $intClassId, $strVersion, $objFile)
{
$objConstant = QcodoConstant::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::QcodoConstant()->QcodoClassId, $intClassId), QQ::Equal(QQN::QcodoConstant()->Variable->Name, $strName)));
if (!$objConstant) {
$objVariable = new Variable();
$objVariable->Name = $strName;
$objVariable->VariableTypeId = VariableType::String;
$objVariable->FirstVersion = $strVersion;
$objVariable->Save();
$objConstant = new QcodoConstant();
$objConstant->Variable = $objVariable;
$objConstant->File = $objFile;
$objConstant->QcodoClassId = $intClassId;
$objConstant->Save();
} else {
if ($objConstant->Variable->LastVersion) {
$objConstant->Variable->LastVersion = null;
$objConstant->Variable->Save();
}
if ($objFile->Id != $objConstant->intFileId) {
$objConstant->File = $objFile;
$objConstant->Save();
}
}
return $objConstant;
}
示例11: 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;
}
示例12: 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)));
}
示例13: txtSearch_KeyUp
public function txtSearch_KeyUp()
{
if (strlen($this->txtSearch->Text) < 2 || preg_match("/^'.*'\$/", $this->txtSearch->Text) || preg_match('/^".*"$/', $this->txtSearch->Text)) {
$this->dtgSuggestion->AdditionalConditions = QQ::AndCondition(QQ::Equal(QQN::NarroSuggestion()->LanguageId, $this->lstLanguage->SelectedValue), QQ::Like(QQN::NarroSuggestion()->Text->TextValue, substr($this->txtSearch->Text, 1, -1)));
} else {
$this->dtgSuggestion->AdditionalConditions = QQ::AndCondition(QQ::Equal(QQN::NarroSuggestion()->LanguageId, $this->lstLanguage->SelectedValue), QQ::Like(QQN::NarroSuggestion()->Text->TextValue, '%' . $this->txtSearch->Text . '%'));
}
$this->dtgSuggestion->Refresh();
}
示例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: GetTranslation
/**
* A translation here consists of the project, file, text, translation, context, plurals, approval, ignore equals
*
* @param string $strOriginal the original text
* @param string $strOriginalAccKey access key for the original text
* @param string $strTranslation the translated text from the import file (can be empty)
* @param string $strOriginalAccKey access key for the translated text
* @param string $strContext the context where the text/translation appears in the file
* @param string $intPluralForm if this is a plural, what plural form is it (0 singular, 1 plural form 1, and so on)
* @param string $strComment a comment from the imported file
*
* @return string valid suggestion
*/
protected function GetTranslation($strOriginal, $strContext)
{
$objNarroContextInfo = NarroContextInfo::QuerySingle(QQ::AndCondition(QQ::Equal(QQN::NarroContextInfo()->Context->ProjectId, $this->objProject->ProjectId), QQ::Equal(QQN::NarroContextInfo()->Context->FileId, $this->objFile->FileId), QQ::Equal(QQN::NarroContextInfo()->Context->ContextMd5, md5($strContext)), QQ::Equal(QQN::NarroContextInfo()->Context->Text->TextValueMd5, md5($strOriginal)), QQ::Equal(QQN::NarroContextInfo()->LanguageId, $this->objTargetLanguage->LanguageId), QQ::IsNotNull(QQN::NarroContextInfo()->ValidSuggestionId)));
if ($objNarroContextInfo instanceof NarroContextInfo) {
return $objNarroContextInfo->ValidSuggestion->SuggestionValue;
} else {
return $strOriginal;
}
}