protected function prepareEntity($entity, $identifier = false)
    {
        $label = (is_array($entity['label'])) ? $this->prepareLabels($entity['label']) : $entity['label'];

        if ($identifier)
        {
            // when the $identifier is used as a flag, we'll take care of generating it.
            if ($identifier === true) $identifier = $this->modelAsNode($entity['label']);

            $label = $identifier.$label;
        }

        $bindings = $entity['bindings'];

        $properties = [];
        foreach ($bindings as $key => $value)
        {
            // From the Neo4j docs:
            //  "NULL is not a valid property value. NULLs can instead be modeled by the absence of a key."
            // So we'll just ignore null keys if they occur.
            if (is_null($value)) continue;

            $key   = $this->propertize($key);
            $value = $this->valufy($value);
            $properties[] = "$key: $value";
        }

        return "($label { ". implode(', ', $properties) .'})';
    }
protected function prepareEntity($entity, $identifier = false)
    {
        $label = (is_array($entity['label'])) ? $this->prepareLabels($entity['label']) : $entity['label'];

        if ($identifier)
        {
            // when the $identifier is used as a flag, we'll take care of generating it.
            if ($identifier === true) $identifier = $this->modelAsNode($entity['label']);

            $label = $identifier.$label;
        }

        $bindings = $entity['bindings'];

        $properties = [];
        foreach ($bindings as $key => $value)
        {
            // From the Neo4j docs:
            //  "NULL is not a valid property value. NULLs can instead be modeled by the absence of a key."
            // So we'll just ignore null keys if they occur.
            if (is_null($value)) continue;

            $key   = $this->propertize($key);
            $value = $this->valufy($value);
            $properties[] = "$key: $value";
        }

        return "($label { ". implode(', ', $properties) .'})';
    }
protected function prepareEntity ( $ entity , $ identifier = false ) { $ label = ( is_array ( $ entity [ 'label' ] ) ) ? $ this -> prepareLabels ( $ entity [ 'label' ] ) : $ entity [ 'label' ] ; if ( $ identifier ) { // when the $identifier is used as a flag, we'll take care of generating it. if ( $ identifier === true ) $ identifier = $ this -> modelAsNode ( $ entity [ 'label' ] ) ; $ label = $ identifier . $ label ; } $ bindings = $ entity [ 'bindings' ] ; $ properties = [ ] ; foreach ( $ bindings as $ key => $ value ) { // From the Neo4j docs: //  "NULL is not a valid property value. NULLs can instead be modeled by the absence of a key." // So we'll just ignore null keys if they occur. if ( is_null ( $ value ) ) continue ; $ key = $ this -> propertize ( $ key ) ; $ value = $ this -> valufy ( $ value ) ; $ properties [ ] = "$key: $value" ; } return "($label { " . implode ( ', ' , $ properties ) . '})' ; }
Prepare an entity's values to be used in a query, performs sanitization and reformatting.

@param  array $entity
@return string
Prepare an entity s values to be used in a query performs sanitization and reformatting .