Skip to content

Instantly share code, notes, and snippets.

@wdebusschere
Last active March 30, 2019 21:45
Show Gist options
  • Save wdebusschere/45b64e011cb49a46d84e5016781e36b6 to your computer and use it in GitHub Desktop.
Save wdebusschere/45b64e011cb49a46d84e5016781e36b6 to your computer and use it in GitHub Desktop.
Entrymanager fetch
//  fetch($entry_id=NULL, $section_id=NULL, $limit=NULL, $start=NULL, $where=NULL, $joins=NULL, $group=false, $buildentries=true, $element_names=null){
		  	$em = new EntryManager();

		    $entries = $em->fetch(null, 83, 10, 0, false, false, false, true, array ('title'));

		  //  	echo "<h2>Products</h2><pre>";print_r($entries);echo "</pre>";die;
        	$product_em = new EntryManager();
		$product_fields = array ('title');
		$products = $product_em->fetch(
		73264,//entry_id
		83,//section_id
		false,//limit
		false,//start
		false,//where
		false,//joins
		false,//group
		true,//buildentries
		array ('title','order'),//element_names
		false,
		true
	);
	
	echo "<h2>Products</h2><pre>";print_r($products);echo "</pre>";die;
	//var_dump($products);
	die;



		echo "<h2>Products</h2><pre>";print_r($resultquery);echo "</pre>";die;
		
	   // $where = 'plan = 76397'
	   $join = "LEFT JOIN `sym_entries_data_950` AS `t950` ON (`e`.`id` = `t950`.entry_id)";
	   $where = "AND `e`.`section_id` = 126 AND (`t950`.relation_id IN ('76391') )";
	    $em = new EntryManager();
		$entries = $em->fetch(null, 126, null, 0, $where, $join, false, true, array ('entities'));

echo "<h2>Products</h2><pre>";print_r($entries);echo "</pre>";die;

To create join/where, make a datasource in symphony and ?debug view queries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment