src/Charcoal/Property/ObjectProperty.php
protected function modelLoader($objType = null)
    {
        if ($objType === null) {
            $objType = $this->objType();
        } elseif (!is_string($objType)) {
            throw new InvalidArgumentException(
                'Object type must be a string.'
            );
        }

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

        self::$modelLoaders[$objType] = new ModelLoader([
            'logger'    => $this->logger,
            'obj_type'  => $objType,
            'factory'   => $this->modelFactory(),
            'cache'     => $this->cachePool()
        ]);

        return self::$modelLoaders[$objType];
    }
protected function modelLoader($objType = null)
    {
        if ($objType === null) {
            $objType = $this->objType();
        } elseif (!is_string($objType)) {
            throw new InvalidArgumentException(
                'Object type must be a string.'
            );
        }

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

        self::$modelLoaders[$objType] = new ModelLoader([
            'logger'    => $this->logger,
            'obj_type'  => $objType,
            'factory'   => $this->modelFactory(),
            'cache'     => $this->cachePool()
        ]);

        return self::$modelLoaders[$objType];
    }
protected function modelLoader ( $ objType = null ) { if ( $ objType === null ) { $ objType = $ this -> objType ( ) ; } elseif ( ! is_string ( $ objType ) ) { throw new InvalidArgumentException ( 'Object type must be a string.' ) ; } if ( isset ( self :: $ modelLoaders [ $ objType ] ) ) { return self :: $ modelLoaders [ $ objType ] ; } self :: $ modelLoaders [ $ objType ] = new ModelLoader ( [ 'logger' => $ this -> logger , 'obj_type' => $ objType , 'factory' => $ this -> modelFactory ( ) , 'cache' => $ this -> cachePool ( ) ] ) ; return self :: $ modelLoaders [ $ objType ] ; }
Retrieve the model loader.

@param  string $objType The object type.
@throws InvalidArgumentException If the object type is invalid.
@return ModelLoader
Retrieve the model loader .