public function setValue($value) { if (null === $value || '' === $value) { $this->_fid = null; $this->_filepath = ''; $value = null; } elseif (is_numeric($value)) { $this->_fid = (int) $value; $this->_filepath = Managedfile::getManagedFilepath($this->_fid); } elseif (is_string($value)) { $this->_filepath = (string) $value; $this->_fid = Managedfile::getManagedFid($this->_filepath, true); } }