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

  • ActiveRecordWrapper
  • Arr
  • Carbonate
  • ClassLoader
  • Collection
  • CollectionDataProvider
  • Facade
  • Factory
  • Fluent
  • Html
  • IterablePager
  • Repository
  • Set
  • Str

Class Factory

In object-oriented programming, a factory is an object for creating other objects – formally a factory is simply an object that returns an object from some method call, which is assumed to be "new". More broadly, a subroutine that returns a "new" object may be referred to as a "factory", as in factory method or factory function. This is a basic concept in OOP, and forms the basis for a number of related software design patterns.

Direct known subclasses

Docolight\Http\ResponseFactory

Abstract
Namespace: Docolight\Support
Author: Krisan Alfa Timur krisanalfa@docotel.co.id
Link: Factory (object-oriented programming)
Located at Docolight/Support/Factory.php

Methods summary

public
# __construct( Docolight\Container\Container $container )

Create a new manager instance.

Create a new manager instance.

Parameters

$container
abstract public string
# getDefaultProduct( )

Get the default product name.

Get the default product name.

Returns

string
public mixed
# produce( string $product = null )

Get a product instance.

Get a product instance.

Parameters

$product

Returns

mixed
protected mixed
# createProduct( string $product )

Create a new product instance.

Create a new product instance.

Parameters

$product

Returns

mixed

Throws

InvalidArgumentException
protected string
# getMethod( string $product )

Get method to create product.

Get method to create product.

Parameters

$product

Returns

string
protected mixed
# callCustomCreator( string $product )

Call a custom product creator.

Call a custom product creator.

Parameters

$product

Returns

mixed
public
# extend( string $product, Closure $callback )

Register a custom product creator Closure.

Register a custom product creator Closure.

Parameters

$product
$callback

Returns


$this
public mixed
# __call( string $method, array $parameters )

Dynamically call the default product instance.

Dynamically call the default product instance.

Parameters

$method
$parameters

Returns

mixed

Properties summary

protected $container

The container instance.

The container instance.

#
protected array $customCreators

The registered custom product creators.

The registered custom product creators.

# []
protected array $products

The array of created "products".

The array of created "products".

# []
LFT API documentation generated by ApiGen