Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.2.0

Request #13838 Method isNew() in Net_LDAP_Entry Object
Submitted: 2008-05-05 14:23 UTC
From: bn8net Assigned: beni
Status: Closed Package: Net_LDAP2 (version 2.0.0RC2)
PHP Version: Irrelevant OS: Debian Etch
Roadmaps: 2.0.0    
Subscription  


 [2008-05-05 14:23 UTC] bn8net (Benjamin Renard)
Description: ------------ Hello, The Net_LDAP_Entry's _new variable is protected so it's impossible to know if an entry is new or not. It will be pratice to have an 'isNew' method to know it. Thanks, Benjamin Renard

Comments

 [2008-05-24 11:39 UTC] beni (Benedikt Hallinger)
$_new is a internal variable for use by the entry class itself to be able to call the proper php ldap method for creation inside the directory server. It does not tell you, if the entry exists in the directory unless the entry is created by Net_LDAP2_Entry->createnew() or ->createexisting(). If you want to check if an entry is present inside the server, use Net_LDAP2->dnExists(). If you want to know if an entry object is new, you should know already, since your code created the object using one of the constructors. I think, adding a isNew() method could be very confusing to the users.
 [2008-05-24 11:40 UTC] beni (Benedikt Hallinger)
What is the use case, that forces you to know that status?
 [2008-05-29 12:24 UTC] beni (Benedikt Hallinger)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Added the method to CVS, i think it will do more good than harm.