src/Search/Framework/SchemaField.php
public function setId(Schema $schema, $id)
    {
        $reset_unique_field = ($schema->getUniqueFieldId() === $this->_id);

        // Reset the identifier, update the hash tables by re-adding the field.
        $schema->removeField($this->_id);
        $this->_id = $id;
        $schema->attachField($this);

        // Update the schema's unique field.
        if ($reset_unique_field) {
            $schema->setUniqueField($id);
        }

        return $this;
    }
public function setId(Schema $schema, $id)
    {
        $reset_unique_field = ($schema->getUniqueFieldId() === $this->_id);

        // Reset the identifier, update the hash tables by re-adding the field.
        $schema->removeField($this->_id);
        $this->_id = $id;
        $schema->attachField($this);

        // Update the schema's unique field.
        if ($reset_unique_field) {
            $schema->setUniqueField($id);
        }

        return $this;
    }
public function setId ( Schema $ schema , $ id ) { $ reset_unique_field = ( $ schema -> getUniqueFieldId ( ) === $ this -> _id ) ; // Reset the identifier, update the hash tables by re-adding the field. $ schema -> removeField ( $ this -> _id ) ; $ this -> _id = $ id ; $ schema -> attachField ( $ this ) ; // Update the schema's unique field. if ( $ reset_unique_field ) { $ schema -> setUniqueField ( $ id ) ; } return $ this ; }
Resets the unique identifier of the field.

The schema is required so that its internal hash table can be updated to
reflect the field's new identifier.

@param Schema $schema
The schema that this field is attached to.
@param string $id
The unique identifier of the field.

@return SchemaField
Resets the unique identifier of the field .