Author: Chad Sikorra (Chad.Sikorra@gmail.com)
コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function execute(LdapOperationInterface $operation)
 {
     $result = @call_user_func($operation->getLdapFunction(), $this->connection->getConnection(), ...$operation->getArguments());
     if ($result === false) {
         throw new LdapConnectionException(sprintf('LDAP %s Operation Error. Diagnostic message: "%s"', $operation->getName(), $this->connection->getDiagnosticMessage()));
     }
     return $result;
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function setOperationDefaults(LdapOperationInterface $operation)
 {
     /** @var QueryOperation $operation */
     if (is_null($operation->getPageSize())) {
         $operation->setPageSize($this->connection->getConfig()->getPageSize());
     }
     if (is_null($operation->getBaseDn())) {
         $operation->setBaseDn($this->getBaseDn());
     }
     if (is_null($operation->getUsePaging())) {
         $operation->setUsePaging($this->connection->getConfig()->getUsePaging());
     }
     $this->parentSetDefaults($operation);
 }
コード例 #3
0
 /**
  * It's possible we need to skip an operation. For example, if a batch operation was only for attribute values that
  * were converted into other operations (such as a modification where only operation generator converters are used).
  * In that case the resulting batch operation will be empty but will have generated post/pre operations for it still.
  * The most common scenario is group membership only changes.
  *
  * @param LdapOperationInterface $operation
  * @return bool
  */
 protected function shouldSkipOperation(LdapOperationInterface $operation)
 {
     return $operation instanceof BatchModifyOperation && empty($operation->getBatchCollection()->toArray());
 }
コード例 #4
0
 /**
  * @param LdapOperationInterface $operation
  */
 public function setOperationDefaults(LdapOperationInterface $operation)
 {
     if (is_null($operation->getServer())) {
         $operation->setServer($this->connection->getServer());
     }
 }