Re: LiveUser applications
| From: | Lukas Smith | Date: | Thu, 09 Jun 2005 21:31:01 +0000 |
| Subject: | Re: LiveUser applications | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-19582@lists.php.net to get a copy of this message | ||
Rodrigo Alvarez wrote:
The question is, how can I add each requested url to liveuser_applications (using LiveUser_Admin addApplication method), automatically, without incrementing the liveuser_applications_seq table?The solution would be to overwrite the definition of the 'application_id' field in the 'applications' table. By default its defined to be 'seq'. You can change it to true or false or some name. 'seq' means use a sequence, true means required, false means not required, name means create a compound index on all fields with the same name put this into your config ... 'permContainer' => array( 'tables' => array(
'applications' => array(
'fields' => array('application_id' => true),
),
),
),
Calling getApplications, and checking that the requested one is not present, would be the way, but this means an "extra" query to the database on each page request. I could be that caching getApplications query in any manner after each addAplication call solves the problem. Another way is to force the application_define_name field to be UNIQUE, and application_id auto_increment (MySQL), but this makes my framework not portable.eventually we will add observers to facilitate caching in the admin part. anyways i dont really understand what you are trying to do. are you just trying to use a string as the application_id? in that case you would also need to change the application_id type. also the seq is not used if you explicitly pass a value for application_id when you pass the data for to add*() methods. regards, Lukas