Returns the file with the given id.
@param integer $id the model id.
@param mixed $with related models that should be eager-loaded.
@return File the model.
515532
public function loadModel($id, $with = array())
    {
        return CActiveRecord::model($this->modelClass)->with($with)->findByPk($id);
    }
285388
public function get($id) {
		// Open the file
		$path = $this->preparePath($id);
		$file = $this->openFile($path);
		
		if ($file === false) { // File is absent or is expired
			return;
		}
		
		// Process the data
		$data = $this->getData($file, $path);
		
		fclose($file);
		
		return $data;
	}
1321593
public function createLocalFileSystem($id)
    {
        $path = $this->getOption(self::OPTION_FILE_PATH).\helpers_File::sanitizeInjectively($id);
        $this->registerLocalFileSystem($id, $path);
        return $this->getFileSystem($id);
    }
1237798
public static function findById($id, $throwException = true)
    {
        $e = $throwException ? new ServerErrorHttpException("Property with id $id not found") : false;

        return static::loadModel(
            $id,
            false,
            true,
            86400,
            $e,
            true
        );
    }
601773
public function fetchById($id)
    {
        if ($this->hasCache()) {
            $data = $this->getCacheItem($id);
            return $data;
        }
        return parent::fetchById($id);
    }
1369109
public function show($id)
    {
        $documentRepository = new DocumentRepository();
        $file = $documentRepository->getFile( $id );
        return response( $file, 200 )->header( 'Content-Type', 'image/jpeg' );
    }
517378
public function getManyBy($key, $value, array $with = array())
    {
        return $this->make($with)->where($key, '=', $value)->get();
    }
1192196
public function get($id)
    {
        $file_name = $this->getFileName($id);

        if (!is_file($file_name) || !is_readable($file_name)) {
            return false;
        }

        $lines    = file($file_name);
        $lifetime = array_shift($lines);
        $lifetime = (int) trim($lifetime);

        if ($lifetime !== 0 && $lifetime < time()) {
            @unlink($file_name);
            return false;
        }
        $serialized = join('', $lines);
        $data       = unserialize($serialized);
        return $data;
    }
738161
public function with($with)
    {
        if (! is_array($with)) {
            $with = func_get_args();
        }

        $this->with = $with;

        return $this;
    }
488874
public function find($id)
    {
        $result = $this->model->findOrFail($id)->toArray();

        return $this->export($result);
    }
455047
public function get($id)
    {
        $entry = $this->readFile($id);
        if ($entry != false && $this->isTtlMode()) {
            $entry = (is_null($entry[static::ENTRY_EXPIRATION]) || $entry[static::ENTRY_EXPIRATION] > $this->getTime())
                ? $entry[static::ENTRY_VALUE]
                : false
            ;
        }
        return $entry;
    }
751176
public function getOrFail($id)
    {
        if ($model = $this->get($id)) {
            return $model;
        }

        throw (new NotFoundException("No results for id $id"))->setModel(get_class($this->model));
    }
1102058
public function loadFile($with = array())
    {
        return $this->getManager()->loadModel($this->owner->{$this->idAttribute}, $with);
    }
1131656
public function getById(int $id)
    {
        $result = $this->builder->getById($id);

        if (isset($result[0])) {
            return self::instance($result[0]);
        }

        return null;
    }
134847
function(id) {
		var file;
		
		if (typeof id === 'number') {
			file = this.uploader.files[id];	
		} else {
			file = this.uploader.getFile(id);	
		}
		return file;
	}
668747
protected function getFileName($id)
    {
        $directory = $this->getDirectory($id);
        $hash      = sha1($id, false);
        $file      = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';
        return $file;
    }
952750
public function getById($id)
    {
        $modelResult = $this->getRequest()->request(
            'GET',
            $this->getRequestUrl(sprintf('models/%s', $id))
        );

        return $this->getModelFromResult($modelResult);
    }