public function asArray()
    {
        $array = [];
        $properties = (new \ReflectionClass($this))
            ->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $object) {
            $value = $object->getValue($this);
            if (!isset($value)) {
                continue;
            }
            $property = $object->getName();

            if (!empty($this->mappings)
                && isset($this->mappings[$property])) {
                $property = $this->mappings[$property];
            }

            $array[$property] = $value;
        }

        return new \ArrayIterator($array);
    }
public function asArray()
    {
        $array = [];
        $properties = (new \ReflectionClass($this))
            ->getProperties(ReflectionProperty::IS_PUBLIC);

        foreach ($properties as $object) {
            $value = $object->getValue($this);
            if (!isset($value)) {
                continue;
            }
            $property = $object->getName();

            if (!empty($this->mappings)
                && isset($this->mappings[$property])) {
                $property = $this->mappings[$property];
            }

            $array[$property] = $value;
        }

        return new \ArrayIterator($array);
    }
public function asArray ( ) { $ array = [ ] ; $ properties = ( new \ ReflectionClass ( $ this ) ) -> getProperties ( ReflectionProperty :: IS_PUBLIC ) ; foreach ( $ properties as $ object ) { $ value = $ object -> getValue ( $ this ) ; if ( ! isset ( $ value ) ) { continue ; } $ property = $ object -> getName ( ) ; if ( ! empty ( $ this -> mappings ) && isset ( $ this -> mappings [ $ property ] ) ) { $ property = $ this -> mappings [ $ property ] ; } $ array [ $ property ] = $ value ; } return new \ ArrayIterator ( $ array ) ; }
The array representation of database object.

@return \ArrayIterator
@throws \ReflectionException
The array representation of database object .