DataObjects/Core_event_audit.php
[Pman.Core] / DataObjects / Images.php
index 37e0579..2845095 100644 (file)
@@ -15,22 +15,18 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
     public $ontable;                         // string(32)  not_null multiple_key
     public $onid;                            // int(11)  not_null
     public $mimetype;                        // string(64)  not_null
-    public $filesize;                        // int(11)  not_null
-    public $created;                         // datetime(19)  not_null binary
-    public $created_by;                         // int(11)  not_null
-
     public $width;                           // int(11)  not_null
     public $height;                          // int(11)  not_null
-    
-
-    public $imgtype;                         // string(32)  not_null
+    public $filesize;                        // int(11)  not_null
+    public $displayorder;                    // int(11)  not_null
+    public $language;                        // string(6)  not_null
     public $parent_image_id;                 // int(11)  not_null
+    public $created;                         // datetime(19)  not_null binary
+    public $imgtype;                         // string(32)  not_null
     public $linkurl;                         // string(254)  not_null
     public $descript;                        // blob(65535)  not_null blob
     public $title;                           // string(128)  not_null
-    public $displayorder;                    // int(11)  not_null
-    public $language;                        // string(6)  not_null
-    
+
     
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
@@ -260,8 +256,18 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
     /**
      * return a list of images for an object, optionally with a mime regex.
      * eg. '%/pdf' or 'image/%'
+     *
+     * usage:
+     *
+     * $i = DB_DataObject::factory('Images');
+     * $i->imgtype = 'LOGO';
+     * $ar = $i->gather($somedataobject, 'image/%');
+     * 
+     * @param {DB_DataObject} dataobject  = the object to gather data on.
+     * @param {String} mimelike  LIKE query to use for search
+     
      */
-    function gather($obj, $mime_like='')
+    function gather($obj, $mime_like='', $opts=array())
     {
         //DB_DataObject::debugLevel(1);
         if (empty($obj->id)) {
@@ -273,7 +279,7 @@ class Pman_Core_DataObjects_Images extends DB_DataObject
         $c->onid = $obj->id;
         $c->autoJoin();
         if (!empty($mime_like)) {
-            $c->whereAdd("mimetype LIKE '". $c->escape($mime_like) ."'");
+            $c->whereAdd("Images.mimetype LIKE '". $c->escape($mime_like) ."'");
         }
 
         return $c->fetchAll();