Changeset 593 for trunk/app/models

Show
Ignore:
Timestamp:
06/07/08 20:48:51 (5 months ago)
Author:
aarkerio
Message:

Comments

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/models/entry.php

    r535 r593  
    3737      'status' => VALID_NOT_EMPTY 
    3838   ); 
     39 
     40public function getComments($blogger_id) 
     41{ 
     42  
     43  $conditions   = array('Entry.user_id'=>$blogger_id); 
     44  $fields       = array('Entry.title', 'Entry.id'); 
     45  $order        = 'Entry.id DESC'; 
     46  $limit        = 30;   
     47  $data         = $this->findAll($conditions, $fields, $order, $limit);  
     48   
     49  foreach($data as $k=>$v): 
     50    if ( count($v['Comment']) < 1): 
     51      unset($data[$k]);  
     52    endif; 
     53  endforeach; 
     54 
     55  return $data; 
     56} 
     57 
     58 
    3959/* 
    4060public $validate = array( 
     
    6181                       ); */ 
    6282} 
    63  
    6483?>