Closed (fixed)
Project:
Domain
Version:
6.x-2.0-rc9
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2009 at 21:24 UTC
Updated:
30 Jan 2010 at 18:40 UTC
I'd like to be able to load a node based on its' type and the domain to which it belongs.
Now, finding a node based on type is pretty straight forward; I just do a :
$node = node_load(array('type' => 'story'));
This doesn't work:
$node = node_load(array('type' => 'story', 'domains' => array('2' => '2'));
I couldn't figure out a programatic way to find a node that is a particular type and that belongs to a particular domain. Instead, I'm just doing it manually thru SQL, joining the node and domain_access table.
Is there a 'recommended' way to programatically get a node that belongs to a particular domain?
TIA
Comments
Comment #1
agentrickardOther than using Views, no. Core node_load() does not allow JOINs to other tables.
Doing a join to {domain_access} should be fine (and properly indexed).
Comment #2
agentrickard