incubator-zeta-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suwandi Tanuwijaya (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ZETACOMP-115) minor update for only once using fetchdefinition on load method
Date Thu, 12 Jan 2012 13:43:39 GMT
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: MvcTools
         Environment: Ubuntu
PHP 5.3
Lighttpd
Simpletest
            Reporter: Suwandi Tanuwijaya
            Priority: Minor


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

        

Mime
View raw message