LoadAll()?

thread: 4 messages  |  last: about 3 years ago  |  started: tuesday, november 18, 2008, 11:50 am pst


#1  |  lezdrum (Rochester, NY) United States of America
Tuesday, November 18, 2008, 11:50 AM PST

I am new to Qcodo and PHP.  I am trying to find documentation on the LoadAll() function.  Can anyone point me in the right direction?

#2  |  VexedPanda (Calgary, AB) Canada
Tuesday, November 18, 2008, 2:05 PM PST

What do you need to know? It does pretty much what it says. It returns an array of all the objects of that type.

#3  |  lezdrum (Rochester, NY) United States of America
Tuesday, November 18, 2008, 2:28 PM PST

I have a mySql table called Country with the following fields.
   country_id int(10)            
     short_description varchar(50)                
     abbreviation char(2)              
     state_flag bit(1)                
     province_flag bit(1)

The country class has the following LoadAll method

/**        
* Load all Companies
* @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
* @return Company[]
*/
public static function LoadAll($objOptionalClauses = null) {
// Call Company::QueryArray to perform the LoadAll query
    try {
   return Company::QueryArray(QQ::All(), $objOptionalClauses);
   } catch (QCallerException $objExc) {
   $objExc->IncrementOffset();
   throw $objExc;
   }
    }


I would like to be able to sort the countries by the short_description field.  But I don't understand the syntax and variables enough to do that yet.

#4  |  VexedPanda (Calgary, AB) Canada
Tuesday, November 18, 2008, 3:00 PM PST
Country::LoadAll(QQ::Clause(QQ::OrderBy(QQN::Country()->ShortDescription)));

I suggest you view the example site and look at all the QQuery examples.



Copyright © 2005 - 2012, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.