public static function getInstance(string $model_class, $where)
    {
        $database = $model_class::getDatabase();
        $primary_key = $database->get(
            $model_class::TABLE,
            $model_class::PRIMARY_KEY,
            $model_class::processWhere($where)
        );
        if ($primary_key) {
            $path = array_merge([$model_class], $primary_key);
            $get_model = Utils\Utils::arrayPathGet(self::$models, $path);
            if ($get_model === null) {
                return new $model_class($primary_key);
            }
            return $get_model;
        }
    }
public static function getInstance(string $model_class, $where)
    {
        $database = $model_class::getDatabase();
        $primary_key = $database->get(
            $model_class::TABLE,
            $model_class::PRIMARY_KEY,
            $model_class::processWhere($where)
        );
        if ($primary_key) {
            $path = array_merge([$model_class], $primary_key);
            $get_model = Utils\Utils::arrayPathGet(self::$models, $path);
            if ($get_model === null) {
                return new $model_class($primary_key);
            }
            return $get_model;
        }
    }
public static function getInstance ( string $ model_class , $ where ) { $ database = $ model_class :: getDatabase ( ) ; $ primary_key = $ database -> get ( $ model_class :: TABLE , $ model_class :: PRIMARY_KEY , $ model_class :: processWhere ( $ where ) ) ; if ( $ primary_key ) { $ path = array_merge ( [ $ model_class ] , $ primary_key ) ; $ get_model = Utils \ Utils :: arrayPathGet ( self :: $ models , $ path ) ; if ( $ get_model === null ) { return new $ model_class ( $ primary_key ) ; } return $ get_model ; } }
Creates a new Model Instancer

@param string  $model_class A Fully Qualified Model Class
@param mixed[] $where       Value for Model Primary Key
or \Medoo\Medoo where clause

@return Model Loaded from Database
@return null  If no entry is found in the Database

@throws \InvalidArgumentException @see Model::processWhere()
Creates a new Model Instancer