LFT
  • Namespace
  • Class
  • Tree

Namespaces

  • Docoflow
    • Contracts
    • Entity
    • Facades
    • Models
    • Traits
  • Docolight
    • Agno
      • Traits
    • Container
    • Http
      • Contracts
    • Rest
      • Handler
      • Http
    • Support
      • Debug
      • Traits
  • Docotory
    • Traits
  • None

Classes

  • Factory

Exceptions

  • ResolvingTypeException

Class Factory

Base factory class. It can produce many type of a product, you can also bind them on the fly.

Docotory\Factory implements ArrayAccess
Abstract
Namespace: Docotory
Author: Krisan Alfa Timur krisanalfa@docotel.co.id
Located at Docotory/Factory.php

Methods summary

public static
# extend( string $type, callable $callable )

Register new custom creator

Register new custom creator

Parameters

$type
$callable
public static
# extendIf( string $type, callable $callable )

Register a custom creator if it has not been registered yet

Register a custom creator if it has not been registered yet

Parameters

$type
$callable
public static
# instance( string $type, mixed $instance )

Register a new instance of a given type

Register a new instance of a given type

Parameters

$type
$instance
public static boolean
# hasCustomCreator( string $type )

Determine if a custom creator has been registered or not

Determine if a custom creator has been registered or not

Parameters

$type

Returns

boolean
public static boolean
# resolved( string $type )

Determine if a type has been resolved

Determine if a type has been resolved

Parameters

$type

Returns

boolean
protected static mixed
# callCustomCreator( string $type )

Call custom creator

Call custom creator

Parameters

$type

Returns

mixed
public mixed
# __get( string $type )

Get type

Get type

Parameters

$type

Returns

mixed

Throws

Docotory\ResolvingTypeException
public
# __set( string $type, mixed $instance )

Set instance of a type

Set instance of a type

Parameters

$type
$instance
public boolean
# offsetExists( mixed $type )

Determine if an item exists at an offset.

Determine if an item exists at an offset.

Parameters

$type

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public mixed
# offsetGet( mixed $type )

Get an item at a given offset.

Get an item at a given offset.

Parameters

$type

Returns

mixed

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( mixed $type, mixed $instance )

Set the item at a given offset.

Set the item at a given offset.

Parameters

$type
$instance

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( string $type )

Unset the item at a given offset.

Unset the item at a given offset.

Parameters

$type

Implementation of

ArrayAccess::offsetUnset()

Properties summary

protected static array $resolved

Resolved types stack

Resolved types stack

# []
protected static array $customCreator

Registered custom creator

Registered custom creator

# []
LFT API documentation generated by ApiGen