/** * Custom setter to disallow directly modifying image metadata, and allow * setting the "image" key. * * @param unknown $fld * @param unknown $value * @param unknown $load (optional) * @return unknown */ public function set($fld, $value, $load = true) { if (in_array($fld, array('img_file_name', 'img_file_size', 'img_content_type', 'img_dtim'))) { throw new Exception("Directly setting {$fld} not allowed! Set the 'image' attribute instead."); } return parent::set($fld, $value, $load); }