Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
WanWizard
a.k.a. WanWizard
Discussions
4
Comments
8242
Activity
PostgreSQL delete() LIMIT
You don't need to copy the entire class, only overload the method you want to change. Other than that, easy peasy... :-)
Comment by
WanWizard
June 2013
permalink
PostgreSQL delete() LIMIT
You can extend it like any other code class, see the documentation.
Comment by
WanWizard
June 2013
permalink
Unittesting and database
I currently use the PHPUnit class methods setUp() and tearDown() for that. Create and add test data in the setup, and drop the table in the teardown. Unit tests run in the 'test' environment, so you can give it its own db.php defining a t…
Comment by
WanWizard
June 2013
permalink
Disable FuelPhp in a specific folder
Exclude the folder from being rewritten in your public/.htaccess.
Comment by
WanWizard
June 2013
permalink
My model doesn't want save related
Have you enabled DB profiling? Do you see any queries being generated?
Comment by
WanWizard
June 2013
permalink
My model doesn't want save related
Appearently not all relations... I don't know what the status of ORM was in 1.5, but given the fact that this is very basic functionality, I would find it odd if it turned out to be broken. Just ran a test here using 1.5, with a many-to-many …
Comment by
WanWizard
June 2013
permalink
Session will not persist
Yes, it uses a custom session, which all security features implemented for sessions. And it's currently released, as part of 1.6.1.
Comment by
WanWizard
June 2013
permalink
MAMP and invalid data source name
http://fuelphp.com/docs/installation/troubleshooting.html#oil_db_error
Comment by
WanWizard
June 2013
permalink
My model doesn't want save related
Are you use your relations are defined ok? And which version of Fuel?
Comment by
WanWizard
June 2013
permalink
Unable to change file permission of uploaded file.
Which version of Fuel? I don't see an obvious reason why that would not work. Does your webserver user have the rights to change the permissions?
Comment by
WanWizard
June 2013
permalink
trouble with Fieldset select field and a pre-set value
Sorry I can't be of assistance this time.
Comment by
WanWizard
June 2013
permalink
trouble with Fieldset select field and a pre-set value
To do that properly is quite complicated. Our (companies) application framework has what we call a "pagelink" system. It can generate links or buttons for this purpose, and when you click on it, it saves the contents of $_POST, before r…
Comment by
WanWizard
June 2013
permalink
trouble with Fieldset select field and a pre-set value
I already wondered why you added the field, if it's a related item, the field should already be there. Just add the dropdown values to the form section of the properties, or use set_options() on the fieldset field: $fieldset->field('…
Comment by
WanWizard
June 2013
permalink
performance cost for loading a model? Should I avoid it?
The only rule I use is "optimize only when you must". Start with a proper design of your application. It should have a correct database schema, code should follow the DRY (don't repeat yourself) and KISS (simple) principles, and not …
Comment by
WanWizard
June 2013
permalink
Phpquickprofiler do not shows sql analyze or other menu data. [solution]
Pushed a fix for this to 1.7/develop, all profiler classes are now prefixed with 'pqp-'.
Comment by
WanWizard
June 2013
permalink
trouble with Fieldset select field and a pre-set value
No, you should take your fieldnames with care. if you are auto populating stuff. If a mapping is found, the value will be assigned by the fieldset. If you have a field that links to a relation, the common thing to do is to use the foreign key for t…
Comment by
WanWizard
June 2013
permalink
performance cost for loading a model? Should I avoid it?
Everything has a performance cost. However, the cost of loading and parsing a class is neglectable compared to the time needed to run the query. On the other hand, over-optimized spaghetti code has a huge maintenance cost due to it's complexi…
Comment by
WanWizard
June 2013
permalink
Orm and Auth conditions
You can only use scalars in property definitions, no function calls. In any type of property. If needed, you can work around that by setting the value at runtime in the _init() method of the Model class. I'll fix the example, time() is a funct…
Comment by
WanWizard
June 2013
permalink
Disable orm cache global
Correct. You should not use the ORM for bulk operations, it will never be fast or efficient.
Comment by
WanWizard
June 2013
permalink
trouble with Fieldset select field and a pre-set value
Used this to test on 1.6/master. Worked fine too? $manufacturer_field = array( 'type' => 'select', 'value'=>2, // hard-coded for testing 'options'=> array(1 => 'value 1', 2 => 'va…
Comment by
WanWizard
June 2013
permalink
trouble with Fieldset select field and a pre-set value
What version of Fuel are you on? This exact code generates this in 1.7/develop: Manufacturer Salt City Glass Yambo
Comment by
WanWizard
June 2013
permalink
Disable orm cache global
Caching happens during hydration. So on every query fired. Caching is done on primary key. When a primary key is detected in the result, and an object with that key is already in cache, hydration doesn't happen, but the object from cache is us…
Comment by
WanWizard
June 2013
permalink
Disable orm cache global
No, there is not. As of 1.6, you can disable the cache on per-query basis, using array('from_cache' => false) on a find(), or from_cache(false) on a query(). It will not have any impact on memory usage (hydration and object creation h…
Comment by
WanWizard
June 2013
permalink
Many To Many. Find by field in 'through' table
Why are you running the same query twice? The second one, with the id's, returns exactly the same records as the first one. public static function search($q, $tag) { $posts = static::query()->related('tags'); strlen($q) > 2 &…
Comment by
WanWizard
June 2013
permalink
Please make a simple, single-page TOC for the docs
We aim to please: https://github.com/fuel/docs/commit/ed1a36e374c50f251b8b5967be5fa96e420b1ed3
Comment by
WanWizard
June 2013
permalink
More Comments
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
About
Username
WanWizard
Joined
January 2011
Visits
2,368
Last Active
3:49AM
Roles
Administrator