public function get($name = null, $default = null)
     {
         $description = $this->getEntityDescription();

        //get the property
        $property = $description->getProperty($name);

         if (!$property) {
             return parent::get($name, $default);
         }

        //get the property name
        $name = $property->getName();

         $value = $this->_data->offsetGet($name);

         if ($property->isRelationship() && $property->isOneToMany() && is_null($value)) {
             //since it's an external relationship
            //lets instantitate a dummy relationship
            //this should happen for the one-to-one relationships
            if ($property->isOneToOne()) {
                return;
            }

             $value = $this->_data[$name] = $property->getSet($this);

             return $value;
         }

         return is_null($value) ? $default : $value;
     }
public function get($name = null, $default = null)
     {
         $description = $this->getEntityDescription();

        //get the property
        $property = $description->getProperty($name);

         if (!$property) {
             return parent::get($name, $default);
         }

        //get the property name
        $name = $property->getName();

         $value = $this->_data->offsetGet($name);

         if ($property->isRelationship() && $property->isOneToMany() && is_null($value)) {
             //since it's an external relationship
            //lets instantitate a dummy relationship
            //this should happen for the one-to-one relationships
            if ($property->isOneToOne()) {
                return;
            }

             $value = $this->_data[$name] = $property->getSet($this);

             return $value;
         }

         return is_null($value) ? $default : $value;
     }
public function get ( $ name = null , $ default = null ) { $ description = $ this -> getEntityDescription ( ) ; //get the property $ property = $ description -> getProperty ( $ name ) ; if ( ! $ property ) { return parent :: get ( $ name , $ default ) ; } //get the property name $ name = $ property -> getName ( ) ; $ value = $ this -> _data -> offsetGet ( $ name ) ; if ( $ property -> isRelationship ( ) && $ property -> isOneToMany ( ) && is_null ( $ value ) ) { //since it's an external relationship //lets instantitate a dummy relationship //this should happen for the one-to-one relationships if ( $ property -> isOneToOne ( ) ) { return ; } $ value = $ this -> _data [ $ name ] = $ property -> getSet ( $ this ) ; return $ value ; } return is_null ( $ value ) ? $ default : $ value ; }
Get the raw value of a property or return the default value passed.

@param  string $name    Then name of the property
@param  mixed  $default The default value

@return mixed
Get the raw value of a property or return the default value passed .