Shanty_Mongo_Document::getPropertyKeys PHP Method

getPropertyKeys() public method

Get a list of all property keys in this document
public getPropertyKeys ( )
    public function getPropertyKeys()
    {
        $keyList = array();
        $doNoCount = array();
        foreach ($this->_data as $property => $value) {
            if ($value instanceof Shanty_Mongo_Document && !$value->isEmpty() || !$value instanceof Shanty_Mongo_Document && !is_null($value)) {
                $keyList[] = $property;
            } else {
                $doNoCount[] = $property;
            }
        }
        foreach ($this->_cleanData as $property => $value) {
            if (in_array($property, $keyList, true) || in_array($property, $doNoCount, true)) {
                continue;
            }
            if (!is_null($value)) {
                $keyList[] = $property;
            }
        }
        return $keyList;
    }

Usage Example

Esempio n. 1
0
 public function __construct(Shanty_Mongo_Document $document)
 {
     $this->_document = $document;
     $this->_properties = $document->getPropertyKeys();
     $this->_position = current($this->_properties);
     reset($this->_properties);
 }
All Usage Examples Of Shanty_Mongo_Document::getPropertyKeys