src/Budkit/Datastore/Model/Entity.php
public function getPropertyValue($propertyName, $objectId = null)
    {

        //You can return this protected properties as objects too.
        if (in_array($propertyName, array("objectId", "objectType", "objectURI")) && isset($this->$propertyName)) {
            return $this->$propertyName;
        }

        $property = strtolower($propertyName);
        //1. Check that the property exists in $dataModel;
        if (!array_key_exists($property, $this->propertyModel))
            return false; //@TODO Raise error? specified column not found
        //2. if isset objectId and object is this object, check value in propertyData
        if ((!empty($objectId) && (int)$objectId == $this->objectId) || empty($objectId)) {
            //IF we have a property that is not defined go get 
            if (!isset($this->propertyData[$property])) {
                //@TODO Database QUERY with objectId
                //Remember that this will most likely be used for 'un-modeled' data
                return;
            }
            //If we already have the property set and the objectId is empty
            return $this->propertyData[$property];
        }
        //3. If we have an Id and its not the same go back to the DB
        //if we have an id
        return;
    }
public function getPropertyValue($propertyName, $objectId = null)
    {

        //You can return this protected properties as objects too.
        if (in_array($propertyName, array("objectId", "objectType", "objectURI")) && isset($this->$propertyName)) {
            return $this->$propertyName;
        }

        $property = strtolower($propertyName);
        //1. Check that the property exists in $dataModel;
        if (!array_key_exists($property, $this->propertyModel))
            return false; //@TODO Raise error? specified column not found
        //2. if isset objectId and object is this object, check value in propertyData
        if ((!empty($objectId) && (int)$objectId == $this->objectId) || empty($objectId)) {
            //IF we have a property that is not defined go get 
            if (!isset($this->propertyData[$property])) {
                //@TODO Database QUERY with objectId
                //Remember that this will most likely be used for 'un-modeled' data
                return;
            }
            //If we already have the property set and the objectId is empty
            return $this->propertyData[$property];
        }
        //3. If we have an Id and its not the same go back to the DB
        //if we have an id
        return;
    }
public function getPropertyValue ( $ propertyName , $ objectId = null ) { //You can return this protected properties as objects too. if ( in_array ( $ propertyName , array ( "objectId" , "objectType" , "objectURI" ) ) && isset ( $ this -> $ propertyName ) ) { return $ this -> $ propertyName ; } $ property = strtolower ( $ propertyName ) ; //1. Check that the property exists in $dataModel; if ( ! array_key_exists ( $ property , $ this -> propertyModel ) ) return false ; //@TODO Raise error? specified column not found //2. if isset objectId and object is this object, check value in propertyData if ( ( ! empty ( $ objectId ) && ( int ) $ objectId == $ this -> objectId ) || empty ( $ objectId ) ) { //IF we have a property that is not defined go get  if ( ! isset ( $ this -> propertyData [ $ property ] ) ) { //@TODO Database QUERY with objectId //Remember that this will most likely be used for 'un-modeled' data return ; } //If we already have the property set and the objectId is empty return $ this -> propertyData [ $ property ] ; } //3. If we have an Id and its not the same go back to the DB //if we have an id return ; }
Returns an entity property value by propery name if exists

@todo Allow for default value setting;
@param string $propertyName
@param interger $objectIdId
@return mixed
Returns an entity property value by propery name if exists