sitegeist / rollup
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:neos-package
Requires
- php: > 8.0
- neos/fusion: ~7.0 || ~8.0 || dev-master
This package is auto-updated.
Last update: 2024-10-30 01:48:35 UTC
README
Fusion Prototypes to instantiate PHP Objects.
Authors & Sponsors
- Martin Ficzel - ficzel@sitegeist.de
- Bernhard Schmitt - schmitt@sitegeist.de
The development and the public-releases of this package is generously sponsored by our employer http://www.sitegeist.de.
Usage
The following php object
<?php
declare(strict_types=1);
namespace Vendor\Example;
use Neos\Flow\Annotations as Flow;
#[Flow\Proxy(false)]
class Thing
{
public function __construct(
public string $foo,
public int $bar
) {}
}
Can be instantiated in Fusion via. If no factoryMethod
is defined
the arguments are passed to the constructor of the class.
thing = Sitegeist.Rollup:Object {
className = 'Vendor\\Example\\Thing'
arguments {
foo = 'hello'
bar = 124
}
}
To instantiate value objects or backed enums the factoryMethod
can
be specified aswell.
other = Sitegeist.Rollup:Object {
className = 'Vendor\\Example\\Thing'
factoryMethod = 'from'
arguments.0 = "XS"
}
stuff = Sitegeist.Rollup:Object {
className = 'Vendor\\Example\\SizeEnum'
factoryMethod = 'fromArray'
arguments.0 = Neos.Fusion:DataStructure {
foo = 'hello'
bar = 124
}
}
Contribution
We will gladly accept contributions. Please send us pull requests.