Reviewed & tested by the community
Project:
PhpStorm templates
Component:
Live Templates
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Feb 2013 at 12:02 UTC
Updated:
30 Jan 2014 at 14:16 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
james.williamsAww, fail... entity_load() needs 2 arguments. Updated patch attached.
Comment #2
sweetchuck->propertyCondition('status', 1)
Not each entity type have field "status".
In the $result array the second level keys are the revision IDs, not the entity_id.
$result['node'][42]42 is a revision ID. {node}.vid.
You can read the NID like this
$result['node'][42]->nidComment #3
james.williamsYes, that's a fair point about the status propertyCondition - but this is just a template for a query, so I would recommend leaving it in there (though perhaps commented out?) as it's too easy to forget that condition.
As for the revision IDs - are you sure? The documentation I've seen for EFQs at http://drupal.org/node/1343708 and http://api.drupal.org/api/drupal/includes%21entity.inc/function/EntityFi... both suggest that you can just pass
array_keys($result[$entity_type$])as the second parameter toentity_load(). I could totally believe that you're right and the documentation isn't, but can you back this up with any documentation/code?Comment #4
sweetchuckSorry. You have true. First level key is the entity_id.
Comment #5
sweetchuckComment #6
seanrHow do I test this? I've applied it to my local copy, but I don't know how to get it into PHPStorm. ./WebIdeConfigManager.php push just skips everything, and I have no idea where PHPStorm puts this stuff to update it manually.
Comment #7
sweetchuck@seanr Here is the documentation where the configurations are http://www.jetbrains.com/phpstorm/webhelp/project-and-ide-settings.html
I don't know why the Manager script skip everything. :-|
Update (pull) both repository (WebIdeConfigManager and phpstorm-templates)
Copy here your file/directory structure. Like this:
Comment #8
sweetchuckEFQ is in the repository because not easy to commit the changes one by one. :-)
If the committed version is not fits for you requirements send new patch.
Comment #9
vlad.dancerI've just checked. Perfect, tnx!
Comment #10
vlad.dancer