src/Model/ModelUtil.php
public function findModelInstanceByIdOrAlias(string $table, $idOrAlias, array $options = [])
    {
        if (!($modelClass = $this->framework->getAdapter(Model::class)->getClassFromTable($table))) {
            return null;
        }

        /* @var Model $adapter */
        if (null === ($adapter = $this->framework->getAdapter($modelClass))) {
            return null;
        }

        if ($this->container->get('huh.utils.dca')->isDcMultilingual($table)) {
            $table = 't1';
        }

        $options = array_merge(
            [
                'limit' => 1,
                'column' => !is_numeric($idOrAlias) ? ["$table.alias=?"] : ["$table.id=?"],
                'value' => $idOrAlias,
                'return' => 'Model',
            ],
            $options
        );

        return $adapter->findByIdOrAlias($idOrAlias, $options);
    }
public function findModelInstanceByIdOrAlias(string $table, $idOrAlias, array $options = [])
    {
        if (!($modelClass = $this->framework->getAdapter(Model::class)->getClassFromTable($table))) {
            return null;
        }

        /* @var Model $adapter */
        if (null === ($adapter = $this->framework->getAdapter($modelClass))) {
            return null;
        }

        if ($this->container->get('huh.utils.dca')->isDcMultilingual($table)) {
            $table = 't1';
        }

        $options = array_merge(
            [
                'limit' => 1,
                'column' => !is_numeric($idOrAlias) ? ["$table.alias=?"] : ["$table.id=?"],
                'value' => $idOrAlias,
                'return' => 'Model',
            ],
            $options
        );

        return $adapter->findByIdOrAlias($idOrAlias, $options);
    }
public function findModelInstanceByIdOrAlias ( string $ table , $ idOrAlias , array $ options = [ ] ) { if ( ! ( $ modelClass = $ this -> framework -> getAdapter ( Model :: class ) -> getClassFromTable ( $ table ) ) ) { return null ; } /* @var Model $adapter */ if ( null === ( $ adapter = $ this -> framework -> getAdapter ( $ modelClass ) ) ) { return null ; } if ( $ this -> container -> get ( 'huh.utils.dca' ) -> isDcMultilingual ( $ table ) ) { $ table = 't1' ; } $ options = array_merge ( [ 'limit' => 1 , 'column' => ! is_numeric ( $ idOrAlias ) ? [ "$table.alias=?" ] : [ "$table.id=?" ] , 'value' => $ idOrAlias , 'return' => 'Model' , ] , $ options ) ; return $ adapter -> findByIdOrAlias ( $ idOrAlias , $ options ) ; }
Returns multiple model instances by given table and id or alias.

@param string $table
@param mixed  $idOrAlias
@param array  $options

@return mixed
Returns multiple model instances by given table and id or alias .