ActiveRecord.php
public static function get($primaryKey, $options = [])
    {
        if ($primaryKey === null) {
            return null;
        }
        $command = static::getDb()->createCommand();
        $result = $command->get(static::index(), static::type(), $primaryKey, $options);
        if ($result['found']) {
            $model = static::instantiate($result);
            static::populateRecord($model, $result);
            $model->afterFind();

            return $model;
        }

        return null;
    }
public static function get($primaryKey, $options = [])
    {
        if ($primaryKey === null) {
            return null;
        }
        $command = static::getDb()->createCommand();
        $result = $command->get(static::index(), static::type(), $primaryKey, $options);
        if ($result['found']) {
            $model = static::instantiate($result);
            static::populateRecord($model, $result);
            $model->afterFind();

            return $model;
        }

        return null;
    }
public static function get ( $ primaryKey , $ options = [ ] ) { if ( $ primaryKey === null ) { return null ; } $ command = static :: getDb ( ) -> createCommand ( ) ; $ result = $ command -> get ( static :: index ( ) , static :: type ( ) , $ primaryKey , $ options ) ; if ( $ result [ 'found' ] ) { $ model = static :: instantiate ( $ result ) ; static :: populateRecord ( $ model , $ result ) ; $ model -> afterFind ( ) ; return $ model ; } return null ; }
Gets a record by its primary key.

@param mixed $primaryKey the primaryKey value
@param array $options options given in this parameter are passed to elasticsearch
as request URI parameters.
Please refer to the [elasticsearch documentation](http://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html)
for more details on these options.
@return static|null The record instance or null if it was not found.
Gets a record by its primary key .