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
Git folder
Yes, it's the git repository with all history. Note that fuel/core, and all packages, also have a .git folder.
Comment by
WanWizard
June 2013
permalink
Can I Use \DB::expr() IN ORM Query?
DB::expr() can not be used with ORM queries in a select(), only in where(). The ORM is not a query builder, use a normal DB. ORM can't produce that group_by either, and because the result doesn't include the primary key, it will also not …
Comment by
WanWizard
June 2013
permalink
slightly modifying OrmAuth to add slug column
Go in the code of the observer and add some debug code. See if it's called, and what it does.
Comment by
WanWizard
June 2013
permalink
Problem with cascade delete
cascade delete only runs a delete on fetched relations, it iterates over the objects and calls delete() on them, it does not run a delete query. So if you want to delete responses too, make sure they are fetched: $quiz = Model_Quiz::find($id, arra…
Comment by
WanWizard
June 2013
permalink
Best practice for finding sum-values of related models-array
It depends, you'll have to test it. You should make sure "invoice" is included in the query (using related), to avoid a second query due to lazy loading. And compare the additional impact of the join (and the loop) with a separate S…
Comment by
WanWizard
June 2013
permalink
OpAuth Problem
Fixed the issues (in 1.7/develop, you can backport it to 1.6.1. without problems). Also added a delete on the provider table to deal with the duplicate logins you're experiencing (although it is still my opinion it is an application design err…
Comment by
WanWizard
June 2013
permalink
OpAuth Problem
Ah, ok. That error exists in 1.7 as well, because the Opauth code was backported to 1.6.1. I'll correct that. That has no relation to the issue you're experiencing though, the match on provider login happens on uid and provider, it does n…
Comment by
WanWizard
June 2013
permalink
OpAuth Problem
The "or" is ok. That if says "if there is no provider linked, or you allow multiple providers". If there is already a provider linked, and you don't allow multiple, that if evaluates to false. In case of multiple providers…
Comment by
WanWizard
June 2013
permalink
OrmAuth
These are special permission modifiers. A = All access. A person that has a role with this modifier will have access to everything, in other words has_access() will always return true. By default this is used for the SuperAdmin role. D = Deny all …
Comment by
WanWizard
June 2013
permalink
Are my requests messed up?
Sessions work with a cookie that is stored client-side, and is sent to the server on each request to maintain state. This requires a client that can handle cookies. cURL can do that, but you need to configure it. Look into the PHP cURL documentatio…
Comment by
WanWizard
June 2013
permalink
Auto Increment in MySQL and creating new Records
Those are two different requests, so without persistence you can't pass it along. Given the fact that it's a SELECT of a single record on primary key, the impact on performance will be minimal, it will be a hit on index. If you want to, …
Comment by
WanWizard
June 2013
permalink
SimpleAuth
So it does run all migrations, you can see that? But it doesn't generate the users table (it's the only table created in the case of Simpleauth)?
Comment by
WanWizard
June 2013
permalink
Upgrading FuelPhp without composer.
No. You need composer, as it not only does the package management (download and install the packages, check dependencies, etc), but it also generates a custom autoloader based on what is has installed. Without this autoloader, it will not work. …
Comment by
WanWizard
June 2013
permalink
OrmAuth
// gives you John echo $user->name; // gives you 564-8990 echo $user->phone; So the key value of the EAV pair will become the property name. To access the EAV attributes you don't need the metadata relation, it's only needed of you…
Comment by
WanWizard
June 2013
permalink
OrmAuth
The user_id column in the tables record the id of the user that last changed the record. This is added for audit purposes, together with the updated_at column you know who changed what when... For User_Permissions: $permission = \Model\Auth_Permis…
Comment by
WanWizard
June 2013
permalink
OrmAuth
by inserting them in the table? It's ORM driven, so something like: $group = \Model\Auth_Group::forge(array('name' => 'New group')); $group->save(); There is no ready-made frontend if that is what you're lookin…
Comment by
WanWizard
June 2013
permalink
Validation, problem with the error messages
It's a lot more economical to pull the errors from the object, and only pass the strings to the View. We use a central Messaging class in our applications, which act like a container for all kinds of messages, and is queried by the page templa…
Comment by
WanWizard
June 2013
permalink
Validation, problem with the error messages
What are you using as Session backend? If you're using cookie based sessions, note that you're storing Validation_Error objects, which can be quite large, too many of them will cause the cookie to be too large, and discarded.
Comment by
WanWizard
June 2013
permalink
Oil - Skin Views - Mysql field attribute "null" ? can knowing this ?
fromdb can not retrieve all details from the table, so some fine-tuning of the model is required. In the model $_properties property, you can indicate that null is allowed for a field using 'null' => true, you can also define a defau…
Comment by
WanWizard
June 2013
permalink
Observer_Slug when updating
Did a quick check. Model_Soft comes with it's own Query class extension, that will inject a "WHERE yourdeletefield IS NULL" in every query generated. So that should work out of the box. Which Fuel version are you on?
Comment by
WanWizard
June 2013
permalink
Observer_Slug when updating
Ah, new information. Please try to be as precise as possible in your reports, it will save us both a lot of time. Observer_Slug was never supported for any model other then the standard ORM model. I added support for Model_Temporal 25 days ago (whi…
Comment by
WanWizard
June 2013
permalink
How To Set Table Name Dinamic?
Yes, why not? It's a protected property, so you need to define a method for it: public static function set_table($table) { static::$_table_name = $table; }
Comment by
WanWizard
June 2013
permalink
Observer_Slug when updating
It should not do that. What Model are you using? And how exactly did you define the observer in your model? Is should be something like: protected static $_observers = array( 'Orm\\Observer_Slug' => array( 'events…
Comment by
WanWizard
June 2013
permalink
Is Not Model_Soft "deleted_at" Setted Automatically by ORM sql builder?
Ah, ok, now I understand. Please make sure you run the latest version (1.6.1), and if it is still an issue, please file a bug report at https://github.com/fuel/orm/issues so it can be looked at.
Comment by
WanWizard
June 2013
permalink
Is Not Model_Soft "deleted_at" Setted Automatically by ORM sql builder?
I dont see an $object->delete() in your code, so where exactly should it set the delete time on that table?
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
12:00AM
Roles
Administrator