Fix AutoDetail=>AutoDelete, add Id to defaults and remove debugging

This commit is contained in:
Isaac Connor 2017-06-20 09:08:15 -04:00
parent 965b306ebc
commit dc96ca72a8
1 changed files with 3 additions and 7 deletions

View File

@ -3,11 +3,12 @@
class Filter { class Filter {
public $defaults = array( public $defaults = array(
'Id' => null,
'Name' => '', 'Name' => '',
'AutoExecute' => 0, 'AutoExecute' => 0,
'AutoExecuteCmd' => 0, 'AutoExecuteCmd' => 0,
'AutoEmail' => 0, 'AutoEmail' => 0,
'AutoDetail' => 0, 'AutoDelete' => 0,
'AutoArchive' => 0, 'AutoArchive' => 0,
'AutoVideo' => 0, 'AutoVideo' => 0,
'AutoMessage' => 0, 'AutoMessage' => 0,
@ -67,16 +68,11 @@ public $defaults = array(
public function terms( ) { public function terms( ) {
if ( func_num_args( ) ) { if ( func_num_args( ) ) {
$this->{'terms'} = func_get_arg(0); $this->{'terms'} = func_get_arg(0);
Warning("terms set " . $this->{'terms'} );
} }
if ( ! isset( $this->{'terms'} ) ) { if ( ! isset( $this->{'terms'} ) ) {
Warning("terms not set " . array_key_exists( 'Query', $this ) );
if ( array_key_exists( 'Query', $this ) and $this->{'Query'} ) { if ( array_key_exists( 'Query', $this ) and $this->{'Query'} ) {
Warning("Decoding terms not set"); $this->{'terms'} = jsonDecode( $this->{'Query'} );
$this->{'terms'} = jsonDecode( $this->{'Query'} );
} else { } else {
Warning("Defaulting terms not set");
$this->{'terms'} = array(); $this->{'terms'} = array();
} }
} }