NotLike() public static method

public static NotLike ( QQNode $objQueryNode, $strValue )
$objQueryNode QQNode
Example #1
0
 public static function _(QQNode $objQueryNode, $strSymbol, $mixValue, $mixValueTwo = null)
 {
     try {
         switch (strtolower(trim($strSymbol))) {
             case '=':
                 return QQ::Equal($objQueryNode, $mixValue);
             case '!=':
                 return QQ::NotEqual($objQueryNode, $mixValue);
             case '>':
                 return QQ::GreaterThan($objQueryNode, $mixValue);
             case '<':
                 return QQ::LessThan($objQueryNode, $mixValue);
             case '>=':
                 return QQ::GreaterOrEqual($objQueryNode, $mixValue);
             case '<=':
                 return QQ::LessOrEqual($objQueryNode, $mixValue);
             case 'in':
                 return QQ::In($objQueryNode, $mixValue);
             case 'not in':
                 return QQ::NotIn($objQueryNode, $mixValue);
             case 'like':
                 return QQ::Like($objQueryNode, $mixValue);
             case 'not like':
                 return QQ::NotLike($objQueryNode, $mixValue);
             case 'is null':
                 return QQ::IsNull($objQueryNode, $mixValue);
             case 'is not null':
                 return QQ::IsNotNull($objQueryNode, $mixValue);
             case 'between':
                 return QQ::Between($objQueryNode, $mixValue, $mixValueTwo);
             case 'not between':
                 return QQ::NotBetween($objQueryNode, $mixValue, $mixValueTwo);
             default:
                 throw new QCallerException('Unknown Query Comparison Operation: ' . $strSymbol, 0);
         }
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
Example #2
0
}
?>

	<h2>Example 3: Managers having one least a project with a conson milestone, and for each manager, the first voyel milestone and the first conson one</h2>
<?php 
$emptySelect = QQ::Select();
$emptySelect->SetSkipPrimaryKey(true);
$nVoyel = QQ::Alias(QQN::Person()->ProjectAsManager->Milestone, 'voyel');
$nConson = QQ::Alias(QQN::Person()->ProjectAsManager->Milestone, 'conson');
$objPersonArray = Person::QueryArray(QQ::IsNotNull($nConson->Id), QQ::Clause(QQ::Expand(QQN::Person()->ProjectAsManager, null, $emptySelect), QQ::Expand($nVoyel, QQ::In($nVoyel->Name, array('Milestone A', 'Milestone E', 'Milestone I')), $emptySelect), QQ::Expand($nConson, QQ::NotIn($nConson->Name, array('Milestone A', 'Milestone E', 'Milestone I')), $emptySelect), QQ::GroupBy(QQN::Person()->Id), QQ::Minimum($nVoyel->Name, 'min_voyel'), QQ::Minimum($nConson->Name, 'min_conson'), QQ::Expand(QQN::Person()->ProjectAsManager, null, $emptySelect), QQ::Minimum(QQN::Person()->ProjectAsManager->Id, 'dummy'), QQ::Select(QQN::Person()->FirstName, QQN::Person()->LastName)));
foreach ($objPersonArray as $objManager) {
    _p($objManager->FirstName . ' ' . $objManager->LastName . " (" . $objManager->GetVirtualAttribute('min_voyel') . ', ' . $objManager->GetVirtualAttribute('min_conson') . ")");
    _p('<br/>', false);
}
?>

	<h2>Example 4: Projects with, for each one, the "min" city from the addresses containing 'r' and the "min" city from the addresses NOT containing 'r' </h2>
<?php 
$nWithR = QQ::Alias(QQN::Project()->PersonAsTeamMember->Person->Address, 'with_r');
$nWithoutR = QQ::Alias(QQN::Project()->PersonAsTeamMember->Person->Address, 'without_r');
$objProjectArray = Project::QueryArray(QQ::All(), QQ::Clause(QQ::Expand($nWithR, QQ::Like($nWithR->Street, '%r%')), QQ::Expand($nWithoutR, QQ::NotLike($nWithoutR->Street, '%r%')), QQ::GroupBy(QQN::Project()->Id), QQ::Minimum($nWithR->City, 'min_city_r'), QQ::Minimum($nWithoutR->City, 'min_city_wor')));
foreach ($objProjectArray as $objProject) {
    _p($objProject->Name . " (" . $objProject->GetVirtualAttribute('min_city_r') . ', ' . $objProject->GetVirtualAttribute('min_city_wor') . ")");
    _p('<br/>', false);
}
QApplication::$Database[1]->OutputProfiling();
?>
</div>

<?php 
require '../includes/footer.inc.php';