Skip to content

Commit

Permalink
Code cleanup and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rowan Lewis committed Feb 1, 2010
1 parent bf3e2ee commit 26d06b9
Show file tree
Hide file tree
Showing 2 changed files with 175 additions and 336 deletions.
55 changes: 26 additions & 29 deletions lib/class.symquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ class SymQuery {
const SYSTEM_ID = 'system:id';
const SYSTEM_DATE = 'system:date';

// Result modes:
const RESULT_ARRAY = 'array';
const RESULT_COUNT = 'count';
const RESULT_DOM = 'dom';
const RESULT_ENTRY = 'entry';
const RESULT_XML = 'xml';

protected static $field_cache = array();
protected static $section_cache = array();
protected static $ready = false;
Expand All @@ -29,28 +22,6 @@ class SymQuery {
protected static $sm = null;
protected static $symphony = null;

protected $section = null;

public function __construct($section) {
if (class_exists('Frontend')) {
$symphony = Frontend::instance();
}

else {
$symphony = Administration::instance();
}

if (!self::$ready) {
self::$db = Symphony::Database();
self::$em = new EntryManager($symphony);
self::$fm = new FieldManager($symphony);
self::$sm = new SectionManager($symphony);
self::$symphony = $symphony;
}

$this->section = self::buildSection($section);
}

/**
* Prepare an object that stores the field and data to filter results with.
*
Expand Down Expand Up @@ -399,6 +370,32 @@ protected static function buildSection($section) {

return $resource;
}

protected $section = null;

public function __construct($section) {
if (class_exists('Frontend')) {
$symphony = Frontend::instance();
}

else {
$symphony = Administration::instance();
}

if (!self::$ready) {
self::$db = Symphony::Database();
self::$em = new EntryManager($symphony);
self::$fm = new FieldManager($symphony);
self::$sm = new SectionManager($symphony);
self::$symphony = $symphony;
}

$this->section = self::buildSection($section);
}
}

class SymQueryExeption extends Exception {

}

?>
Loading

0 comments on commit 26d06b9

Please sign in to comment.