Overview
  • Package
  • Class
  • Tree
  • Todo

Packages

  • AddonValue
    • Interfaces
  • AdminHttpViewControllers
  • ApiV2Controllers
  • Authentication
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Strategies
  • Category
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • Customer
    • Address
    • Country
    • CountryZone
    • Interfaces
    • Storages
    • Validation
    • ValueObjects
  • Email
    • Collections
    • Entities
    • Exceptions
    • Interfaces
    • Repository
    • ValueObjects
  • Extensions
    • Customers
    • Emails
    • Helpers
    • Invoices
    • Orders
    • Serializers
    • Templates
  • Http
    • Collections
    • Exceptions
    • Factories
    • Interfaces
    • ValueObjects
  • HttpViewControllers
  • InfoBox
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
  • Invoice
    • Interfaces
    • ValueObjects
  • Loaders
    • CrossCuttingLoader
    • GXCoreLoader
    • Interfaces
  • Modules
    • Collections
    • Controllers
    • Interfaces
  • None
  • Order
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
    • ValueObjects
  • Precheck
  • Product
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Providers
    • Repositories
    • Storages
  • ProductModule
    • Collections
    • Deleter
    • Entities
    • Factories
    • Interface
    • Interfaces
    • Reader
    • Repositories
    • Writer
  • Shared
    • ClassFinder
    • Exceptions
    • FileSystem
    • Interfaces
    • Storage
    • Types
  • SharedShoppingCart
    • Interfaces
  • Slider
    • Collections
    • Entities
    • Factories
    • Interfaces
    • Repositories
    • Storages
  • Statistics
    • Interfaces
  • UserConfiguration
    • Interfaces
    • Repository

Classes

  • CrossCuttingLoader
  • StaticCrossCuttingLoader

Class CrossCuttingLoader

Class CrossCuttingLoader

CrossCuttingLoader enables loading of mockable objects for cross cutting concerns, that were not injected to the current object.

Important: RegisteredObjectsOnly flag must be enabled for unit testing.

CrossCuttingLoader implements CrossCuttingLoaderInterface
Package: Loaders\CrossCuttingLoader
Category: System
Located at Loaders/CrossCuttingLoader/CrossCuttingLoader.inc.php

Methods summary

public object
# getObject( string $p_classname )

In strict mode ($strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.

In strict mode ($strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.

Parameters

$p_classname

Returns

object

Throws

InvalidArgumentException

Implementation of

CrossCuttingLoaderInterface::getObject()
public
# setRegisteredObjectsOnly( boolean $bool_status )

RegisteredObjectsOnly Flag Setter

RegisteredObjectsOnly Flag Setter

If RegisteredObjectsOnly is enabled, the loader returns only objects, that were registered by the registerObject method before. RegisteredObjectsOnly should be enabled in all unit tests.

Parameters

$bool_status

Implementation of

CrossCuttingLoaderInterface::setRegisteredObjectsOnly()
public boolean
# useRegisteredObjectsOnly( )

RegisteredObjectsOnly Flag Getter

RegisteredObjectsOnly Flag Getter

Returns

boolean

Implementation of

CrossCuttingLoaderInterface::useRegisteredObjectsOnly()
public
# registerObject( string $p_classname, object $object )

In strict mode ($strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.

In strict mode ($strictModeEnabled=true) this method accepts classes with implemented CrossCuttingObjectInterface only. Otherwise it throws an InvalidArgumentException.

Parameters

$p_classname
$object

Throws

InvalidArgumentException

Implementation of

CrossCuttingLoaderInterface::registerObject()
public
# clearRegister( )

Implementation of

CrossCuttingLoaderInterface::clearRegister()
protected object
# _getObjectFromRegister( string $p_classname )

Parameters

$p_classname

Returns

object
protected object
# _getObjectFromMainFactory( string $p_classname )

Parameters

$p_classname

Returns

object
protected
# _strictModeValidateTypeOf( $object )

Parameters

$object

Throws

InvalidArgumentException

Properties summary

protected boolean $strictModeEnabled

Todo

Move to CrossCuttingLoaderSettings
# true
protected boolean $registeredObjectsOnly
# false
protected array $registeredObjectArrays
# array()
API documentation generated by ApiGen