src/Model/ManufacturableModelLoaderTrait.php
protected function modelLoader($objType, $objKey = null)
    {
        if (!is_string($objType)) {
            throw new InvalidArgumentException(sprintf(
                'The object type must be a string, received %s',
                get_var_type($objType)
            ));
        }

        $key = $objKey;
        if ($key === null) {
            $key = '_';
        } elseif (!is_string($key)) {
            throw new InvalidArgumentException(sprintf(
                'The object property key must be a string, received %s',
                get_var_type($key)
            ));
        }

        if (isset(self::$modelLoaders[$objType][$key])) {
            return self::$modelLoaders[$objType][$key];
        }

        $builder = $this->modelLoaderBuilder();

        self::$modelLoaders[$objType][$key] = $builder($objType, $objKey);

        return self::$modelLoaders[$objType][$key];
    }
protected function modelLoader($objType, $objKey = null)
    {
        if (!is_string($objType)) {
            throw new InvalidArgumentException(sprintf(
                'The object type must be a string, received %s',
                get_var_type($objType)
            ));
        }

        $key = $objKey;
        if ($key === null) {
            $key = '_';
        } elseif (!is_string($key)) {
            throw new InvalidArgumentException(sprintf(
                'The object property key must be a string, received %s',
                get_var_type($key)
            ));
        }

        if (isset(self::$modelLoaders[$objType][$key])) {
            return self::$modelLoaders[$objType][$key];
        }

        $builder = $this->modelLoaderBuilder();

        self::$modelLoaders[$objType][$key] = $builder($objType, $objKey);

        return self::$modelLoaders[$objType][$key];
    }
protected function modelLoader ( $ objType , $ objKey = null ) { if ( ! is_string ( $ objType ) ) { throw new InvalidArgumentException ( sprintf ( 'The object type must be a string, received %s' , get_var_type ( $ objType ) ) ) ; } $ key = $ objKey ; if ( $ key === null ) { $ key = '_' ; } elseif ( ! is_string ( $ key ) ) { throw new InvalidArgumentException ( sprintf ( 'The object property key must be a string, received %s' , get_var_type ( $ key ) ) ) ; } if ( isset ( self :: $ modelLoaders [ $ objType ] [ $ key ] ) ) { return self :: $ modelLoaders [ $ objType ] [ $ key ] ; } $ builder = $ this -> modelLoaderBuilder ( ) ; self :: $ modelLoaders [ $ objType ] [ $ key ] = $ builder ( $ objType , $ objKey ) ; return self :: $ modelLoaders [ $ objType ] [ $ key ] ; }
Retrieve the object laoder for the given model.

@param  string      $objType The target model.
@param  string|null $objKey  The target model's key to load by.
@throws InvalidArgumentException If the $objType or $objKey are invalid.
@return ModelLoader
Retrieve the object laoder for the given model .