Shanty_Mongo_Document::isEmpty PHP Method

isEmpty() public method

Test to see if this document is empty
public isEmpty ( ) : boolean
return boolean
    public function isEmpty()
    {
        $doNoCount = array();
        foreach ($this->_data as $property => $value) {
            if ($value instanceof Shanty_Mongo_Document) {
                if (!$value->isEmpty()) {
                    return false;
                }
            } elseif (!is_null($value)) {
                return false;
            }
            $doNoCount[] = $property;
        }
        foreach ($this->_cleanData as $property => $value) {
            if (in_array($property, $doNoCount)) {
                continue;
            }
            if (!is_null($value)) {
                return false;
            }
        }
        return true;
    }