You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-issues@incubator.apache.org by "Suwandi Tanuwijaya (Created) (JIRA)" <ji...@apache.org> on 2012/01/12 13:43:39 UTC

[jira] [Created] (ZETACOMP-115) minor update for only once using fetchdefinition on load method

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

        

[jira] [Updated] (ZETACOMP-115) minor update for only once using fetchdefinition on load method

Posted by "Suwandi Tanuwijaya (Updated) (JIRA)" <ji...@apache.org>.
     [ 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