Let me focus on specific parts of your questions:
I don't know if I should even be drawing a relationship between these
As a rule of thumb, if the relationship is important, you should show it on your diagram. So the answer to this one is: yes, you should show it.
I am building a class diagram where "Interface A" is implemented by a member of "Class B".
First, to be on the same page, let me start from what an interface is:
Interface, in C#, is a code structure that defines a contract between an object and its user. It contains a collection of semantically similar properties and methods that can be implemented by a class or a struct that adheres to the contract.1
While the definition here is for C#, in general, it is valid for all modern programming languages.
Let me emphasise this - interface is a contract. It means that class that implements the interface has to adhere to that contract. In other words, it has to implement methods listed in the contract (interface). It does not mean though that it contains an interface as a property. On the contrary, every class can (and usually has to) implement the methods required by the interface in various ways, depending on the internal structure of the class itself. Moreover by adding the interface the way you did in your snippet you do not make the class adhere to the contract.
Typically class implementation is declared on the class definition level and then the method itself has to be directly declared again in the class body. Unlike on interface, there the methods are only listed (thus defining the contract), in the class it has to contain the body of the class itself (thus implementation).
A typical code for that will look something like that (the way implementation is declared depends on the programming language):
interface ISampleInterface {
public void sampleMethod();
}
// You see interface declaration at the very beginning
class SampleClass implements ISampleInterface {
// Internal class structure ensuring the right behaviour, data stracture etc.
private int someVarName;
private void doSomethingMethod(int someDoInternalVar) {
someVarName = someVarName + someDoInternalVar;
}
// Methods required by the interface, including their body
public void sampleMethod() {
int someInternalVarName;
doSomethingMethod(someVarName);
}
}
This example uses Java notation, but in other languages you have some similar constructs. PHP actually will look exactly the same, in C# you will have a slightly different way of interface implementation declaration:
interface ISampleInterface {
public void sampleMethod();
}
class SampleClass : ISampleInterface {
public void sampleMethod() {
}
}
For this type of "proper" interface implementation, the UML notation is a dashed line with an empty triangle, going from the class to the interface it implements:
For more details please have a look at Section 10.4.5 of UML Specification, especially figure 10.11.
Your code snippet is somewhat misleading though, as it indicates that an interface is a member of a class, not that the class itself implements it. I must say I am not sure what your intention is here as I have never seen such approach. I am not a programmer though.
If you are sure you want to have interface as a property of a class rather than class implementing the interface (i.e. adhering to the interface contract), then the typical notation here will depend on how strong your relationship is. In general, it is some kind of association (so solid line). Whether it is a stronger relationship (shared or composite aggregation, so hollow or filled diamond on class side respectively) will depend on your specific case. I strongly recommend checking answers to this question as they explain it with all details. Yet, since you probably want your interface to die with your object, that would be a composite aggregation.
1https://www.techopedia.com/definition/27989/interface-c
class SampleClass implements ISampleInterface {}
(this, of course, depends on the language). As the name suggests, then the class has to implement the methods required by the interface(directly on the class level). Please clarify if that is what you want to achieve.