composer package updates
[openemr.git] / vendor / adldap2 / adldap2 / src / Connections / ProviderInterface.php
blob68f70ac036393ed5f02cd9de96909a248cdb5aa4
1 <?php
3 namespace Adldap\Connections;
5 use Adldap\Auth\GuardInterface;
6 use Adldap\Schemas\SchemaInterface;
7 use Adldap\Configuration\DomainConfiguration;
9 interface ProviderInterface
11 /**
12 * Constructor.
14 * @param DomainConfiguration|array $configuration
15 * @param ConnectionInterface|null $connection
16 * @param SchemaInterface|null $schema
18 public function __construct($configuration, ConnectionInterface $connection, SchemaInterface $schema = null);
20 /**
21 * Returns the current connection instance.
23 * @return ConnectionInterface
25 public function getConnection();
27 /**
28 * Returns the current configuration instance.
30 * @return DomainConfiguration
32 public function getConfiguration();
34 /**
35 * Returns the current Guard instance.
37 * @return \Adldap\Auth\Guard
39 public function getGuard();
41 /**
42 * Returns a new default Guard instance.
44 * @param ConnectionInterface $connection
45 * @param DomainConfiguration $configuration
47 * @return \Adldap\Auth\Guard
49 public function getDefaultGuard(ConnectionInterface $connection, DomainConfiguration $configuration);
51 /**
52 * Sets the current connection.
54 * @param ConnectionInterface $connection
56 * @return $this
58 public function setConnection(ConnectionInterface $connection = null);
60 /**
61 * Sets the current configuration.
63 * @param DomainConfiguration|array $configuration
65 public function setConfiguration($configuration = []);
67 /**
68 * Sets the current LDAP attribute schema.
70 * @param SchemaInterface|null $schema
72 * @return $this
74 public function setSchema(SchemaInterface $schema = null);
76 /**
77 * Returns the current LDAP attribute schema.
79 * @return SchemaInterface
81 public function getSchema();
83 /**
84 * Sets the current Guard instance.
86 * @param GuardInterface $guard
88 * @return $this
90 public function setGuard(GuardInterface $guard);
92 /**
93 * Returns a new Model factory instance.
95 * @return \Adldap\Models\Factory
97 public function make();
99 /**
100 * Returns a new Search factory instance.
102 * @return \Adldap\Query\Factory
104 public function search();
107 * Returns a new Auth Guard instance.
109 * @return \Adldap\Auth\Guard
111 public function auth();
114 * Connects and Binds to the Domain Controller.
116 * If no username or password is specified, then the
117 * configured administrator credentials are used.
119 * @param string|null $username
120 * @param string|null $password
122 * @throws \Adldap\Auth\BindException When binding to your LDAP server fails.
124 * @return ProviderInterface
126 public function connect($username = null, $password = null);