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

Traits

  • HasFactories

Trait HasFactories

A helper trait to make your implementation has a factory.

Direct Known Users

Docolight\Agno\AgnoModule

Namespace: Docotory\Traits
Author: Krisan Alfa Timur krisanalfa@docotel.co.id
Located at Docotory/Traits/HasFactories.php

Methods summary

public mixed
# factory( string $factory )

Resolve a factory. Keep in mind that factory would be resolved via container method. So make sure if the accessor is an alias, register it on a container by calling:

Resolve a factory. Keep in mind that factory would be resolved via container method. So make sure if the accessor is an alias, register it on a container by calling:

container()->alias('FooClass', 'foo');

Parameters

$factory
Name of your registered factory

Returns

mixed
protected boolean
# factoryHasBeenResolved( string $factory )

Determine if a factory has been resolved

Determine if a factory has been resolved

Parameters

$factory
Factory name

Returns

boolean
public boolean
# hasFactory( string $factory )

Determine if your factory has been registered or not.

Determine if your factory has been registered or not.

Parameters

$factory
Name of your factory

Returns

boolean
public
# registerFactory( string $factory, string $containerAccessor, boolean $replace = false )

Register your factory

Register your factory

Parameters

$factory
$containerAccessor
$replace
public
# registerFactories( array $factories, boolean $replace = false )

Register your factory from key / value pair array

Register your factory from key / value pair array

Parameters

$factories
$replace
public array
# factories( )

Return all registered factories.

Return all registered factories.

Returns

array

Properties summary

protected array $factories

A key / value pair array of your registered factories

A key / value pair array of your registered factories

# []
protected array $resolvedFactories

A key / value pair array of your resolved factories

A key / value pair array of your resolved factories

# []
LFT API documentation generated by ApiGen