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); }
function FindAll() { /* * Columns: id, slug, description, full_html (boolean), content */ return MyActiveRecord::FindAll('Chunks'); }
function FindAll() { /* * Columns: id, display_name, email, password, is_admin, is_staff */ return MyActiveRecord::FindAll('Users', NULL, " id ASC"); }
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'); } }
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'); } }
function FindAll($order = "ASC") { return MyActiveRecord::FindAll('Documents', NULL, " id {$order}"); }
function FindPublic() { return MyActiveRecord::FindAll('NLLists', 'public = 1'); }
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"); }
function FindAll() { return MyActiveRecord::FindAll('Product', NULL, " id ASC"); }
function FindAll() { return MyActiveRecord::FindAll('NLEmails', '', 'id ASC'); }
function FindAll($orderby = 'display_name ASC') { return MyActiveRecord::FindAll('Testimonials', null, $orderby); }
function get_photos() { return MyActiveRecord::FindAll('Photos', "gallery_id = {$this->id}", "display_order, id ASC"); }
function FindAll() { return MyActiveRecord::FindAll('categories', "", "display_name ASC"); }
function FindAll() { return MyActiveRecord::FindAll('EventPeriods'); }
function get_children() { return MyActiveRecord::FindAll('Pages', "parent_page_id={$this->id}", 'display_order ASC'); }
function FindForEvent($event_id) { if ($event_id) { return MyActiveRecord::FindAll('Recurrence', "event_id={$event_id}"); } }
function FindAll() { return MyActiveRecord::FindAll('Alias'); }
function FindPublicSections($orderby = "display_order, id ASC") { return MyActiveRecord::FindAll('Sections', 'public = 1', $orderby); }
function FindAll($order = "DESC") { return MyActiveRecord::FindAll("MailBlast", null, "date_sent {$order}"); }
function FindAll($calendar_id = 1) { return MyActiveRecord::FindAll('EventTypes', "calendar_id = {$calendar_id}", "name ASC"); }
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); } }
function FindAll() { return MyActiveRecord::FindAll('Photos', NULL, " id ASC"); }
function FindAll() { return MyActiveRecord::FindAll('Paypal_Config', NULL, " id ASC"); }
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; }