Dotclear

Changeset 1266:f18660c2ca33 for inc


Ignore:
Timestamp:
08/05/13 12:44:48 (12 years ago)
Author:
akewea
Branch:
ticket1084
Message:

ticket#1084 : add a boolean parameter to getPostMedia to choose the return type : resultSet (for LoopPosition? to work) or Array (default).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.media.php

    r1220 r1266  
    497497     @param    post_id   <b>integer</b>      Post ID 
    498498     @param    media_id  <b>integer</b>      Optionnal media ID 
     499     @param    rs   <b>boolean</b>      Whether to return a resultset (true) or an array (false, default value). 
    499500     @return   <b>array</b> Array of fileItems 
    500501     */ 
    501      public function getPostMedia($post_id,$media_id=null) 
     502     public function getPostMedia($post_id,$media_id=null,$rs=false) 
    502503     { 
    503504          $params = array( 
     
    515516               $f = $this->fileRecord($rs); 
    516517               if ($f !== null) { 
    517                     $res[] = new ArrayObject($f); 
    518                } 
    519           } 
    520            
    521           return $res; 
     518                    $res[] = $rs ? new ArrayObject($f) : $f; 
     519               } 
     520          } 
     521           
     522          return $rs ? staticRecord::newFromArray($res) : $res; 
    522523     } 
    523524      
Note: See TracChangeset for help on using the changeset viewer.

Sites map