Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Bug Reports » Enum Type and 0 index.
Re: Enum Type and 0 index. [message #398 is a reply to message #397] Tue, 14 November 2006 08:56 Go to previous messageGo to previous message
AJM is currently offline  AJM
Messages: 2361
Registered: April 2006
Location: Surrey, UK
Senior Member
The correct way to load an ENUM field is to put the following code in the _cm_getValRep() method:
    if ($item == 'enum_field') {
        $array = $this->getEnum($item);
    } // if

This obtains the array of values from the database, but is indexed from 1 not 0.

I think I should change the export function so that when it creates the array of values in the ?.dict.inc file it forces the first index to be 1, as follows:
'values' => array(1 => 'entered', 'modified', 'submitted', 'approved', 'rejected', 'deleted')

The reason that I stopped using ENUM fields in my code is that Radicore has to support other databases, and ENUM fields are unique to MySQL.


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: std.batch.inc
Next Topic: setOrderBy function working incorrectly
Goto Forum:
  


Current Time: Sun Aug 25 00:19:55 EDT 2024

Total time taken to generate the page: 0.01077 seconds