protected function save_has_foreign_relations() {

		foreach ( $this->_relations as $attribute => $value ) {
			$relation = $this->get_relation( $attribute );

			if ( $relation instanceof HasForeign && $value ) {

				$value = $relation->persist( $value );
				$pk    = $relation->get_pk_for_value( $value );

				$this->set_raw_attribute( $attribute, $pk );
				$this->_relations[ $attribute ] = $value;
			}
		}
	}