Example #1
0
 /**
  * Load all Myassetses
  * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
  * @return Myassets[]
  */
 public static function LoadAll($objOptionalClauses = null)
 {
     if (func_num_args() > 1) {
         throw new QCallerException("LoadAll must be called with an array of optional clauses as a single argument");
     }
     // Call Myassets::QueryArray to perform the LoadAll query
     try {
         return Myassets::QueryArray(QQ::All(), $objOptionalClauses);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
 }
Example #2
0
 private function GetAssetsData()
 {
     $objClauses = array();
     array_push($objClauses, QQ::OrderBy(QQN::Myassets()->Title));
     if ($objClause = $this->dtrAssets->LimitClause) {
         array_push($objClauses, $this->dtrAssets->LimitClause);
     }
     if ($this->txtSearchAssets->Text != '') {
         $condition = QQ::AndCondition(QQ::OrCondition(QQ::Like(QQN::Myassets()->Title, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Author, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Artist, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Actor, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Director, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Publisher, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Label, '%' . $this->txtSearchAssets->Text . '%'), QQ::Like(QQN::Myassets()->Isbn, '%' . $this->txtSearchAssets->Text . '%')), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
     } else {
         $condition = QQ::AndCondition(QQ::NotEqual(QQN::Myassets()->Asin, ''), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
     }
     $arrResult = Myassets::QueryArray($condition, $objClauses);
     $this->dtrAssets->TotalItemCount = Myassets::QueryCount($condition);
     $this->dtrAssets->DataSource = $arrResult;
 }
Example #3
0
 private function GetAssetsData($productgroup)
 {
     $objClauses = array();
     array_push($objClauses, QQ::OrderBy(QQN::Myassets()->Title));
     if ($objClause = $this->dtrMyLibrary->LimitClause) {
         array_push($objClauses, $this->dtrMyLibrary->LimitClause);
     }
     if ($this->txtSearchTerm->Text == "") {
         $condition = QQ::AndCondition(QQ::Equal(QQN::Myassets()->ProductGroup, $productgroup), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
         $arrResult = Myassets::QueryArray($condition, $objClauses);
         $this->dtrMyLibrary->TotalItemCount = Myassets::QueryCount($condition);
         $this->dtrMyLibrary->DataSource = $arrResult;
     } else {
         $objCondition = QQ::AndCondition(QQ::OrCondition(QQ::Like(QQN::Myassets()->Title, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Author, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Artist, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Actor, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Director, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Publisher, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Label, '%' . $this->txtSearchTerm->Text . '%'), QQ::Like(QQN::Myassets()->Isbn, '%' . $this->txtSearchTerm->Text . '%')), QQ::Equal(QQN::Myassets()->ProductGroup, $productgroup), QQ::Equal(QQN::Myassets()->Owner, $_SESSION['User']));
         $objDbResult = Myassets::QueryArray($objCondition, $objClauses);
         $myassets = $objDbResult;
         $this->dtrMyLibrary->TotalItemCount = Myassets::QueryCount($objCondition);
         if ($this->dtrMyLibrary->TotalItemCount > 0) {
             $this->dtrMyLibrary->DataSource = $myassets;
         } else {
             QApplicationBase::DisplayAlert('No ' . $productgroup . 's exists for the searched term');
         }
     }
 }