LdapTools\Factory\LdapObjectSchemaFactory::get PHP Метод

get() публичный Метод

Get the LdapObjectSchema for a specific schema name and object type.
public get ( string $schemaName, string $objectType ) : LdapObjectSchema
$schemaName string
$objectType string
Результат LdapTools\Schema\LdapObjectSchema
    public function get($schemaName, $objectType)
    {
        $cacheItem = $schemaName . '.' . $objectType;
        if ($this->shouldBuildCacheItem($schemaName, $cacheItem)) {
            $ldapObjectSchema = $this->parser->parse($schemaName, $objectType);
            $this->dispatcher->dispatch(new LdapObjectSchemaEvent(Event::LDAP_SCHEMA_LOAD, $ldapObjectSchema));
            $this->cache->set($ldapObjectSchema);
        } else {
            $ldapObjectSchema = $this->cache->get(LdapObjectSchema::getCacheType(), $cacheItem);
        }
        return $ldapObjectSchema;
    }

Usage Example

 /**
  * @param LdapObjectSchemaFactory $schemaFactory
  * @param LdapObjectSchema ...$schemaObjects
  */
 protected function cacheAllLdapSchemaObjects(LdapObjectSchemaFactory $schemaFactory, LdapObjectSchema ...$schemaObjects)
 {
     /** @var LdapObjectSchema $ldapSchemaObject */
     foreach ($schemaObjects as $ldapSchemaObject) {
         $schemaFactory->get($ldapSchemaObject->getSchemaName(), $ldapSchemaObject->getObjectType());
     }
 }
All Usage Examples Of LdapTools\Factory\LdapObjectSchemaFactory::get