<?php
class Core_Validate_File_Type extends Core_Validate_File_Abstract
{
    protected $_types        = array();
    protected $_errorMessage = 'Datoteka nije ispravnog tipa, prihvaćamo %types%';

    protected function _isValid($file)
    {
        return in_array($file->getType(), $this->getTypes());
    }

    public function setTypes($types)
    {
        $this->_types = (array) $types;
        return $this;
    }

    public function getTypes()
    {
        return $this->_types;
    }
}