[
https://issues.apache.org/jira/browse/ZETACOMP-115?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Suwandi Tanuwijaya updated ZETACOMP-115:
----------------------------------------
Component/s: (was: MvcTools)
PersistentObject
> minor update for only once using fetchdefinition on load method
> ---------------------------------------------------------------
>
> Key: ZETACOMP-115
> URL: https://issues.apache.org/jira/browse/ZETACOMP-115
> Project: Zeta Components
> Issue Type: Improvement
> Components: PersistentObject
> Environment: Ubuntu
> PHP 5.3
> Lighttpd
> Simpletest
> Reporter: Suwandi Tanuwijaya
> Priority: Minor
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> It is not desired for 'load' method on ezcPersistentLoadHandler class using
> fetchdefinition twice ( another one is on loadIntoObject ). My quick-fix is
> like these ( I simply move it to loadIntoObject to handle it ):
> // ... etc
> public function load( $object, $id )
> {
> return $this->loadIntoObject( $object, $id );
> }
> // ... etc
>
> public function loadIntoObject( $object, $id )
> {
> if( ! is_object( $object ) )
> {
> $class = $object;
>
> $def = $this->definitionManager->fetchDefinition( $class );
> $object = new $def->class;
> }
> else $def = $this->definitionManager->fetchDefinition( get_class(
> $object ) );
> // ... etc
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira