protected function Drupali18nSyncNodeReferenceTestCase::getReferencedNodes in i18n node reference synch 7
Returns the nids of the referenced articles.
Parameters
int $page_nid: Nid of the page to return the article references for.
Return value
array Nids of all referenced articles.
1 call to Drupali18nSyncNodeReferenceTestCase::getReferencedNodes()
- Drupali18nSyncNodeReferenceTestCase::assertPageReferencesNodes in ./
i18n_node_reference.test - Asserts that the page references the articles.
File
- ./
i18n_node_reference.test, line 210 - Test node reference field synchronization.
Class
- Drupali18nSyncNodeReferenceTestCase
- Unit test for node reference field synchronisation.
Code
protected function getReferencedNodes($page_nid) {
$node = node_load($page_nid, NULL, TRUE);
$items = field_get_items('node', $node, 'field_article');
$nids = array();
if ($items) {
foreach ($items as $item) {
$nids[] = $item['nid'];
}
}
return $nids;
}