. */ /** * Doctrine_File * * @package Doctrine * @subpackage File * @author Konsta Vesterinen * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @version $Revision$ * @link www.phpdoctrine.com * @since 1.0 */ class Doctrine_File extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('url', 'string', 255); } public function setUp() { $this->actAs('Searchable', array('className' => 'Doctrine_File_Index', 'fields' => array('url', 'content'))); $this->index('url', array('fields' => array('url'))); } public function get($name, $load = true) { if ($name === 'content') { return file_get_contents(parent::get('url')); } return parent::get($name, $load); } }