We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We're using lazy loading e.g. in in Bib::getRecord. Perhaps the implementation could benefit from using ProxyManager.
Bib::getRecord
The text was updated successfully, but these errors were encountered:
Seems like Ghost Object Proxies could be used. It's possible to exclude some properties from triggering the loading. E.g. in Bibs:
Bibs
public function get() { $args = func_get_args(); $id = $args[0]; $factory = new LazyLoadingGhostFactory(); $initializer = function ( GhostObjectInterface $ghostObject, string $method, array $parameters, & $initializer, array $properties ) { $initializer = null; // disable initialization // load data and modify the object here (note: the constructor has not yet been called) // $properties["\0*\0mms_id"] = $id; // Inherited from proxy object? $ghostObject->load(); return true; // confirm that initialization occurred correctly }; $proxyOptions = [ 'skippedProperties' => [ "\0*\0mms_id", "\0*\0client", "\0*\0_holdings", // Will this work? ], ]; $instance = $factory->createProxy(\Scriptotek\Bibs\Bib::class, $initializer, $proxyOptions); $instance->mms_id = $id; return $instance; }
Sorry, something went wrong.
No branches or pull requests
We're using lazy loading e.g. in in
Bib::getRecord
. Perhaps the implementation could benefit from using ProxyManager.The text was updated successfully, but these errors were encountered: