<?php
class Model_DbTable_Clanky extends Zend_Db_Table_Abstract {
	protected $_name = 'klipy_clanky';
	public function getLast($count = 5){
		$statement = $this->select()->limit($count);
		$result = $this->fetchAll($statement);
		$clanky = array();
		foreach ($result as $clanok){
		  $pos = strpos($clanok->content, '<!--line-->');
		  if ( $pos !== false ){
    		$clanok->content = substr($clanok->content, 0 , $pos);
		  }
		  $clanky[] = $clanok;		
		}
		return $clanky;	
	}
}
?>