* @date Aug 21, 2011 */ class RemoteFileExtendedProxy extends RemoteFileProxy { /** * @var RemoteFile */ protected $_realRemoteFile = null; /** * @var int */ protected $_fileId = 0; /** * Load file by file id * * @param int $fileId */ public function loadById($fileId) { $this -> _fileId = $fileId; } public function getFileId() { return $this -> _fileId; } public function getFileName() { return $this -> _getRealRemoteFile() -> getFileName(); } public function getFileSize() { return $this -> _getRealRemoteFile() -> getFileSize(); } public function getFileContents() { return $this -> _getRealRemoteFile() -> getFileContents(); } /** * @return RemoteFileProxy */ public function _getRealRemoteFile() { if (null == $this -> _realRemoteFile) { $this -> _realRemoteFile = new RemoteFileProxy(); $this -> _realRemoteFile -> loadById($this -> _fileId); } return $this -> _realRemoteFile; } }