Overview #

The DropNull process will drop the row which has null value or meet certain number of null occurrences.

Let look at an example:

->query("select * from customers")
->pipe(new DropNull())

Above is simplest example of using DropNull process. All the row which has null value will be dropped. As a result, return data will be those customers with full information.

Target a certain columns only #

Sometime you only drop the row if some certain columns has null values:

->pipe(new DropNull(array(

Exclude some columns #

If you want to target all columns except some because it is not important, you do:

->pipe(new DropNull(array(

Target specific type of columns #

For example, You can target number columns only, if any of those columns has null value, the row will be dropped:

->pipe(new DropNull(array(

You can target to other column types which are string,date,datetime,time

Threshold #

For example, if data row contains more than 2 null values, drop the row:

->pipe(new DropNull(array(

Targeted value #

What if you do not want to drop null value but the 0 value. The missing data to you is the 0 value, you can do

->pipe(new DropNull(array(

Of course, you can set any target values regardless number type or string type. The default value of targetValue is null.

Strictly Null #

By default the the null could be empty string or 0 value. To enable strict comparison of both value and type, you set the following:

->pipe(new DropNull(array(