public function set($key, $value)
    {
        if ($key === self::ENTRY_EDGE_DEFINITIONS) {
            if ($this->_doValidate) {
                ValueValidator::validate($value);
            }

            $edgeDefinitionBaseObject = new EdgeDefinition();

            foreach ($value as $ed) {
                $edgeDefinition = clone $edgeDefinitionBaseObject;

                foreach ($ed[self::ENTRY_FROM] as $from) {
                    $edgeDefinition->addFromCollection($from);
                }
                foreach ($ed[self::ENTRY_TO] as $to) {
                    $edgeDefinition->addToCollection($to);
                }
                $edgeDefinition->setRelation($ed[self::ENTRY_COLLECTION]);
                $this->addEdgeDefinition($edgeDefinition);
            }
        } else if ($key === self::ENTRY_ORPHAN_COLLECTIONS) {
            if ($this->_doValidate) {
                ValueValidator::validate($value);
            }

            foreach ($value as $o) {
                $this->addOrphanCollection($o);
            }
        } else {
            parent::set($key, $value);
        }
    }
public function set($key, $value)
    {
        if ($key === self::ENTRY_EDGE_DEFINITIONS) {
            if ($this->_doValidate) {
                ValueValidator::validate($value);
            }

            $edgeDefinitionBaseObject = new EdgeDefinition();

            foreach ($value as $ed) {
                $edgeDefinition = clone $edgeDefinitionBaseObject;

                foreach ($ed[self::ENTRY_FROM] as $from) {
                    $edgeDefinition->addFromCollection($from);
                }
                foreach ($ed[self::ENTRY_TO] as $to) {
                    $edgeDefinition->addToCollection($to);
                }
                $edgeDefinition->setRelation($ed[self::ENTRY_COLLECTION]);
                $this->addEdgeDefinition($edgeDefinition);
            }
        } else if ($key === self::ENTRY_ORPHAN_COLLECTIONS) {
            if ($this->_doValidate) {
                ValueValidator::validate($value);
            }

            foreach ($value as $o) {
                $this->addOrphanCollection($o);
            }
        } else {
            parent::set($key, $value);
        }
    }
public function set ( $ key , $ value ) { if ( $ key === self :: ENTRY_EDGE_DEFINITIONS ) { if ( $ this -> _doValidate ) { ValueValidator :: validate ( $ value ) ; } $ edgeDefinitionBaseObject = new EdgeDefinition ( ) ; foreach ( $ value as $ ed ) { $ edgeDefinition = clone $ edgeDefinitionBaseObject ; foreach ( $ ed [ self :: ENTRY_FROM ] as $ from ) { $ edgeDefinition -> addFromCollection ( $ from ) ; } foreach ( $ ed [ self :: ENTRY_TO ] as $ to ) { $ edgeDefinition -> addToCollection ( $ to ) ; } $ edgeDefinition -> setRelation ( $ ed [ self :: ENTRY_COLLECTION ] ) ; $ this -> addEdgeDefinition ( $ edgeDefinition ) ; } } else if ( $ key === self :: ENTRY_ORPHAN_COLLECTIONS ) { if ( $ this -> _doValidate ) { ValueValidator :: validate ( $ value ) ; } foreach ( $ value as $ o ) { $ this -> addOrphanCollection ( $ o ) ; } } else { parent :: set ( $ key , $ value ) ; } }
Set a graph attribute

The key (attribute name) must be a string.
This will validate the value of the attribute and might throw an
exception if the value is invalid.

@throws ClientException

@param string $key   - attribute name
@param mixed  $value - value for attribute

@return void
Set a graph attribute