Class Novedades extends Base{
function __construct($datos=NULL){
if(!is_null($datos))
{
$this->id = $datos->id;
$this->foto_id = $datos->foto_id;
$this->galeria_id = $datos->galeria_id;
$this->titulo = $datos->titulo;
$this->bajada = $datos->bajada;
$this->bajada_corta = recortarCadena($this->bajada, 150);
$this->cuerpo = $datos->cuerpo;
$this->pdf_id = $datos->pdf_id;
parse_str(parse_url( $datos->video_link, PHP_URL_QUERY ), $video);
$this->video_link = isset($video['v'])?'https://www.youtube.com/embed/'.$video['v']:'';
$this->link_externo = $datos->link_externo;
$this->orden = $datos->orden;
$this->uri = url('novedades').'/'.$datos->uri.'-'.$this->id;
$this->foto();
$this->galeria();
$this->pdf();
}
}
public function pdf(){
$pdf = $this->pdf = Archivo::obtener(array('id' => $this->pdf_id), array(
'controlador' => array(
'nombre' => 'novedades',
'id' => $this->id
)
));
if(isset($pdf->src)){
$pdf->titulo = basename($pdf->src);
}
return $pdf;
}
public function galeria(){
return $this->galeria = Foto::obtener(array('galeria' => $this->galeria_id), array(
'medidas' => array(
array(
'ancho' => 660,
'alto' => 350,
'default' => true,
'src_default' => '660x350.jpg',
),
),
'controlador' => array(
'nombre' => 'novedades',
'id' => $this->id
)
));
}
public function foto(){
return $this->foto = Foto::obtener(array('id' => $this->foto_id), array(
'medidas' => array(
array(
'ancho' => 290,
'alto' => 127,
'src_default' => '290x127.jpg',
),
),
'controlador' => array(
'nombre' => 'novedades',
'id' => $this->id
)
));
}
static function porUsuario($usuario){
return Novedades::obtener(array('porusuario'=>$usuario));
}
static function recientes($limit,$id){
return Novedades::obtener(array('recientes'=>array($limit,$id)));
}
protected static function filtro($tabla, $tipo, $dato = null){
$filtro = parent::filtro($tabla, $tipo, $dato);
switch($tipo){
case 'recientes':
$filtro = array(
'order' => 'id DESC',
'where' => 'id!='.$dato[1],
'limit' => $dato[0]
);
break;
}
return $filtro;
}
static function obtener( $filtros = array(), $dato = null, $modelo = '', $tabla = ''){
$filtros = !is_array($filtros) ? array($filtros => $dato) : $filtros;
$elementos = parent::obtener($filtros, $dato, 'Novedades', 'novedades');
return $elementos;
}
}
?>
Fatal error: Class 'Novedades' not found in /home/ceramicaroja/domains/ceramicaroja.com.ar/public_html/novedades.php on line 15