DB_DataObject_FormBuilder hide_primary_key

From: Date: Fri, 07 Nov 2003 00:38:21 +0000
Subject: DB_DataObject_FormBuilder hide_primary_key
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-23313@lists.php.net to get a copy of this message
DB_DataObject_FormBuilder documentation: * <li>hide_primary_key: * By default, hidden fields are generated for the primary key of a DataObject. * This behaviour can be deactivated by setting this option to 0.</li> the corresponding code: if ((isset($this->_do->hide_primary_key) && $this->_do->hide_primary_key === false) || (isset($_DB_DATAOBJECT_FORMBUILDER['CONFIG']['hide_primary_key']) && $_DB_DATAOBJECT_FORMBUILDER['CONFIG']['hide_primary_key'] == 0)
    {
       $hidePrimary = false;
    }
This is a little bit confusing. It should be noted in the documentation that setting this option to 0 has only effect in the DataObject.ini file. If you want to set this property "run-time" you can NOT do $do->hide_primary_key = 0; since the check is type-safe here (===). You have to do $do->hide_primary_key = false; in your code. In my opinion the documentation should be modified, or it should be considered if this check has to be type safe or a simple == is enough as in the case of DataObjects.ini

« previous php.pear.dev (#23313) next »