public function getData($property = AnDomain::ACCESS_PUBLIC, $default = null)
    {
        $description = $this->getEntityDescription();

        if (gettype($property) === 'integer') {
            $properties = $this->getEntityDescription()->getProperty();
            $access = (int) $property;
            $data = array();

            foreach ($properties as $name => $property) {
                if ($property->getReadAccess() >= $access) {
                    $data[$name] = $this->getData($name);
                }
            }

            return $data;
        }

        if (!$prop = $description->getProperty($property)) {
            return $this->get($property, $default);
        }

        $method = 'get'.ucfirst($property);

        if ($this->methodExists($method)) {
            $value = $this->$method();
        } else {
            $value = $this->get($property);
        }

        if (is_null($value)) {
            $value = $default;
        }

        return $value;
    }
public function getData($property = AnDomain::ACCESS_PUBLIC, $default = null)
    {
        $description = $this->getEntityDescription();

        if (gettype($property) === 'integer') {
            $properties = $this->getEntityDescription()->getProperty();
            $access = (int) $property;
            $data = array();

            foreach ($properties as $name => $property) {
                if ($property->getReadAccess() >= $access) {
                    $data[$name] = $this->getData($name);
                }
            }

            return $data;
        }

        if (!$prop = $description->getProperty($property)) {
            return $this->get($property, $default);
        }

        $method = 'get'.ucfirst($property);

        if ($this->methodExists($method)) {
            $value = $this->$method();
        } else {
            $value = $this->get($property);
        }

        if (is_null($value)) {
            $value = $default;
        }

        return $value;
    }
public function getData ( $ property = AnDomain :: ACCESS_PUBLIC , $ default = null ) { $ description = $ this -> getEntityDescription ( ) ; if ( gettype ( $ property ) === 'integer' ) { $ properties = $ this -> getEntityDescription ( ) -> getProperty ( ) ; $ access = ( int ) $ property ; $ data = array ( ) ; foreach ( $ properties as $ name => $ property ) { if ( $ property -> getReadAccess ( ) >= $ access ) { $ data [ $ name ] = $ this -> getData ( $ name ) ; } } return $ data ; } if ( ! $ prop = $ description -> getProperty ( $ property ) ) { return $ this -> get ( $ property , $ default ) ; } $ method = 'get' . ucfirst ( $ property ) ; if ( $ this -> methodExists ( $ method ) ) { $ value = $ this -> $ method ( ) ; } else { $ value = $ this -> get ( $ property ) ; } if ( is_null ( $ value ) ) { $ value = $ default ; } return $ value ; }
get the value of a property by checking for custom getter. If no property
is passed an array of properties is returend.

@param string $property Property name
@param string $default  Default value

@return mixed
get the value of a property by checking for custom getter . If no property is passed an array of properties is returend .