I need to modify the database query to not select a certain ID in the database so the items with that ID do not show in the results. However, I cannot figure out how to do this. below I added a WHERE statement but I don't know if this is the right way to do this or if it is even created correctly.
->where ('geo.fid' != 887)
Any help would be much appreciated.
protected function loadEntries( &$data, $conditions )
{
$db = SPFactory::db();
$table = $db->join( array(
array( 'table' => 'spdb_field_geo', 'as' => 'geo', 'key' => 'sid' ),
array( 'table' => 'spdb_object', 'as' => 'spo', 'key' => 'id' )
) );
if ( Sobi::My( 'id' ) ) {
$this->userPermissionsQuery( $conditions, 'spo.' );
}
else {
$conditions = array_merge( $conditions, array( 'spo.state' => '1', '@VALID' => $db->valid( 'spo.validUntil', 'spo.validSince' ) ) );
}
$data[ 'entries' ] = SPFactory::db()
->select( array( 'geo.sid', 'geo.latitude', 'geo.longitude' ), $table, $conditions )
->where ('geo.fid' != 887) // this is what I am trying to add but it breaks the code.
->loadAssocList();
Sobi::Trigger( 'SPGeoMap', 'AfterGetEntries', array( &$data[ 'entries' ] ) );
$data[ 'count' ] = count( $data[ 'entries' ] );
}