Dotclear

Changeset 1268:8ae42b11a9cb


Ignore:
Timestamp:
08/05/13 13:30:27 (11 years ago)
Author:
akewea
Branch:
ticket1084
Children:
1269:383c341506b4, 1404:8beafb9886a7
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

    r1267 r1268  
    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). 
     499     @param    $returnRs <b>boolean</b>      Whether to return a resultset (true) or an array (false, default value). 
    500500     @return   <b>array</b> Array or ResultSet of fileItems 
    501501     */ 
    502      public function getPostMedia($post_id,$media_id=null,$rs=false) 
     502     public function getPostMedia($post_id,$media_id=null,$returnRs=false) 
    503503     { 
    504504          $params = array( 
     
    516516               $f = $this->fileRecord($rs); 
    517517               if ($f !== null) { 
    518                     $res[] = $rs ? new ArrayObject($f) : $f; 
    519                } 
    520           } 
    521            
    522           return $rs ? staticRecord::newFromArray($res) : $res; 
     518                    $res[] = $returnRs ? new ArrayObject($f) : $f; 
     519               } 
     520          } 
     521           
     522          return $returnRs ? staticRecord::newFromArray($res) : $res; 
    523523     } 
    524524      
Note: See TracChangeset for help on using the changeset viewer.

Sites map