<?
	require('../include/config.php');
	require('../include/class.source.php');
	$n = new Source($db);
	
	$source = $_POST['source'];
	
	$s = $n->getSource($source);
	if (!isset($s['source_id'])) {
		$n->Insert(Array(
			'source_id' => $source,
			'source_name' => $source,
			'type' => 'good'
		));
	} else {
		var_dump($n->setType(Array(
			'type' => 'good',
			'source_id' => $source
		)));
	}
?>
Example #2
0
 /**
  * Creates a new Zend\Feed\Writer\Source data container for use. This is NOT
  * added to the current feed automatically, but is necessary to create a
  * container with some initial values preset based on the current feed data.
  *
  * @return Source
  */
 public function createSource()
 {
     $source = new Source();
     if ($this->getEncoding()) {
         $source->setEncoding($this->getEncoding());
     }
     $source->setType($this->getType());
     return $source;
 }
<?
	require('../include/config.php');
	require('../include/class.source.php');
	$n = new Source($db);
	
	$source = $_POST['source'];
	
	$s = $n->getSource($source);
	if (!isset($s['source_id'])) {
		$n->Insert(Array(
			'source_id' => $source,
			'source_name' => $source,
			'type' => 'bad'
		));
	} else {
		$n->setType(Array(
			'type' => 'bad',
			'source_id' => $source
		));
	}
?>