Beispiel #1
0
 function FindAll($orderby = "display_name ASC")
 {
     /*
      * Columns: id, slug, display_name, service (youtube, vimeo), embed (shortcode or unique ID), width, height, gallery_id, display_order
      */
     return MyActiveRecord::FindAll('Videos', NULL, $orderby);
 }
Beispiel #2
0
 function FindAll()
 {
     /*
      * Columns: id, slug, description, full_html (boolean), content
      */
     return MyActiveRecord::FindAll('Chunks');
 }
Beispiel #3
0
 function FindAll()
 {
     /*
      * Columns: id, display_name, email, password, is_admin, is_staff
      */
     return MyActiveRecord::FindAll('Users', NULL, " id ASC");
 }
Beispiel #4
0
 function FindAll($exclude = true)
 {
     // Let's speed up this query and exclude the blob fields... too much memory for nothing.
     if ($exclude) {
         return MyActiveRecord::FindBySql('Images', "SELECT id, name, title, description FROM images ORDER BY id DESC");
     } else {
         return MyActiveRecord::FindAll('Images');
     }
 }
Beispiel #5
0
 function FindAll($orderby = "id ASC", $exclude = true)
 {
     //return MyActiveRecord::FindAll('Items', NULL, " $orderby");
     // Let's speed up this query and exclude the blob fields... too much memory for nothing.
     if ($exclude) {
         return MyActiveRecord::FindBySql('Items', "SELECT id, name, display_name, content, template, display_order, sku, price, taxonomy, public, public2, date_created, date_revised FROM items ORDER BY {$orderby}");
     } else {
         return MyActiveRecord::FindAll('Items');
     }
 }
Beispiel #6
0
 function FindAll($order = "ASC")
 {
     return MyActiveRecord::FindAll('Documents', NULL, " id {$order}");
 }
Beispiel #7
0
 function FindPublic()
 {
     return MyActiveRecord::FindAll('NLLists', 'public = 1');
 }
Beispiel #8
0
 function FindPublicAreas()
 {
     return MyActiveRecord::FindAll('areas', "public = 1", "display_order, id DESC");
 }
 function FindForItem($item_id)
 {
     return MyActiveRecord::FindAll('portfolioimages', "item_id = {$item_id}", "id ASC");
 }
Beispiel #10
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('Product', NULL, " id ASC");
 }
Beispiel #11
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('NLEmails', '', 'id ASC');
 }
Beispiel #12
0
 function FindAll($orderby = 'display_name ASC')
 {
     return MyActiveRecord::FindAll('Testimonials', null, $orderby);
 }
Beispiel #13
0
 function get_photos()
 {
     return MyActiveRecord::FindAll('Photos', "gallery_id = {$this->id}", "display_order, id ASC");
 }
Beispiel #14
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('categories', "", "display_name ASC");
 }
Beispiel #15
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('EventPeriods');
 }
Beispiel #16
0
 function get_children()
 {
     return MyActiveRecord::FindAll('Pages', "parent_page_id={$this->id}", 'display_order ASC');
 }
Beispiel #17
0
 function FindForEvent($event_id)
 {
     if ($event_id) {
         return MyActiveRecord::FindAll('Recurrence', "event_id={$event_id}");
     }
 }
Beispiel #18
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('Alias');
 }
Beispiel #19
0
 function FindPublicSections($orderby = "display_order, id ASC")
 {
     return MyActiveRecord::FindAll('Sections', 'public = 1', $orderby);
 }
Beispiel #20
0
 function FindAll($order = "DESC")
 {
     return MyActiveRecord::FindAll("MailBlast", null, "date_sent {$order}");
 }
Beispiel #21
0
 function FindAll($calendar_id = 1)
 {
     return MyActiveRecord::FindAll('EventTypes', "calendar_id = {$calendar_id}", "name ASC");
 }
Beispiel #22
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('Blogs');
 }
 /**
  * returns array of 'child' objects.
  * e.g.
  * <code>
  * foreach( $topic->find_children('Post') as $post ) print $post->subject;
  * </code>
  *
  * In order for the above to work, you would need to have an integer field called 'Topic_id'
  * in your 'Post' table. MyActiveRecord will take care of the rest.
  *
  * @param string  strClass  Name of the class of objects to return in the array
  * @param mixed mxdCondition Either a SQL 'WHERE' fragment or an array of paramaters that must be matched ( see FindAll() )
  * @param string strOrderBy a SQL ORDER BY strring fragment
  * @param integer intLimit  limit on number of records to retrieve
  * @param integer intOffset if you don't want to begin with the first child you can add an offset here
  * @param strForeignKey if the foreign key is not parent_id but something different you can specify here
  * @param mixed optional sql condition expressed as either a sql string or an array
  *          eg: 'flagged=true' or array( 'flagged'=>1 );
  * @return  array array containing objects of class strClass
  */
 public function find_children($strClass, $mxdCondition = NULL, $strOrderBy = '`id` ASC', $intLimit = 10000, $intOffset = 0, $strForeignKey = NULL)
 {
     // name of foreign key:
     $key = $strForeignKey ? $strForeignKey : strtolower(get_class($this) . '_id');
     if (is_array($mxdCondition) || is_null($mxdCondition)) {
         // specifiy condition as an array
         $mxdCondition[$key] = $this->id;
         return MyActiveRecord::FindAll($strClass, $mxdCondition, $strOrderBy, $intLimit, $intOffset);
     } else {
         // condition is non-null string
         $fullSQLCondition = "{$key}={$this->id} AND ({$mxdCondition})";
         return MyActiveRecord::FindAll($strClass, $fullSQLCondition, $strOrderBy, $intLimit, $intOffset);
     }
 }
Beispiel #24
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('Photos', NULL, " id ASC");
 }
Beispiel #25
0
 function FindAll()
 {
     return MyActiveRecord::FindAll('Paypal_Config', NULL, " id ASC");
 }
Beispiel #26
0
 static function FindAll($strClass, $extend = false, $mxdWhere = null, $strOrderBy = null, $intLimit = null, $intOffset = null)
 {
     if (!AppModel::_smartLoadModel($strClass)) {
         return false;
     }
     $model = AppModel::Create($strClass);
     $intLimit = get_default($intLimit, 10000);
     $intOffset = get_default($intOffset, 0);
     $strOrderBy = get_default($strOrderBy, $model->order_by);
     $objects = parent::FindAll($strClass, $mxdWhere, $strOrderBy, $intLimit, $intOffset);
     if ($extend) {
         AppModel::AddAllRelated($objects);
     }
     return $objects;
 }