Perform the actual mixin of all registered mixins for an object

@param  ObjectIdentifier $identifier
@param  ObjectMixable    $mixer
@return ObjectMixable    The mixed object
550781
protected function _mixin(ObjectIdentifier $identifier, $mixer)
    {
        if ($mixer instanceof ObjectMixable)
        {
            $mixins = $identifier->getMixins();

            foreach ($mixins as $key => $value)
            {
                if (is_numeric($key)) {
                    $mixer->mixin($value);
                } else {
                    $mixer->mixin($key, $value);
                }
            }
        }

        return $mixer;
    }
1233455
public function findByIdentifier($identifier)
    {
        if (!isset($this->plugins[$identifier])) {
            $identifier = $this->normalizeIdentifier($identifier);
        }

        if (!isset($this->plugins[$identifier])) {
            return null;
        }

        return $this->plugins[$identifier];
    }
15316
protected function _instantiateEntity($identifier, $data)
    {
        $identifier = clone $identifier;
        $identifier->package = str_replace('com_', '', $data['option']);
        register_default(array(
            'identifier' => $identifier,
            'default' => array('ComComponentsDomainEntityComponent')
        ));

        return clone AnDomain::getRepository($identifier)->getClone();
    }
276605
public function registerObject($object, $identifier)
    {
        $this->objectMap[$object] = $identifier;
        $this->identifierMap[$identifier] = $object;
    }
488848
public function normalizeIdentifier($identifier)
    {
        foreach ($this->plugins as $id => $object) {
            if (strtolower($id) == strtolower($identifier)) {
                return $id;
            }
        }

        return $identifier;
    }
1286084
protected function createClient($identifier)
    {
        try {
            $reflection = new \ReflectionClass($identifier);
            if (!$reflection->isSubclassOf('\PommProject\ModelManager\ModelLayer\ModelLayer')) {
                throw new ModelLayerException(sprintf("Class '%s' is not a subclass of ModelLayer.", $identifier));
            }
        } catch (\ReflectionException $e) {
            throw new ModelLayerException(sprintf("Error while loading class '%s' (%s).", $identifier, $e->getMessage()));
        }

        return new $identifier();
    }
1004799
public function addFixture($object, $identifier)
    {
        if (!isset($this->fixtures[get_class($object)])) {
            $this->fixtures[get_class($object)] = [];
        }
        
        $this->fixtures[get_class($object)][$identifier] = $object->ID;
    }
1094492
public function storeObject ($identifier, $object)
		{
			if (! is_object($object)) {
				throw new DependencyException('You must pass an object to storeObject');
			}

			$this->rules[$identifier] = new StoredObjectRule($object);

			return $this;
		}
690792
private function convertToFieldDefintionObject($identifier, $fieldDefinition)
    {
        if ($fieldDefinition instanceof FieldDefinitionObject) {
            return $fieldDefinition;
        } else {
            return new FieldDefinitionObject($identifier, $this, $fieldDefinition);
        }
    }
967741
public function mixin(AnMixinInterface $object, $config = array())
    {
        if ($object instanceof AnControllerBehaviorAbstract) {
            foreach ($object->getMethods() as $method) {
                if (substr($method, 0, 7) == '_action') {
                    $this->_actions[] = strtolower(substr($method, 7));
                }
            }

            $this->_actions = array_unique(array_merge($this->_actions, array_keys($this->_action_map)));
        }

        return parent::mixin($object, $config);
    }
502691
public static function doEscapeIdentifier($Identifier, $instance=null) {
		self::prepareInstance($instance);
		return self::$instances[$instance]->escapeIdentifier($Identifier);
	}
795207
public function buildForm($identifier = null)
	{
		$this->setFormMapper(new FormMapper);
		$this->configureForm($this->getFormMapper());

		$this->setFormBuilder(new FormBuilder($this->getFormMapper()));
		$this->getFormBuilder()
			->setModel($this->getModel())
			->setIdentifier($identifier)
			->setContext($identifier === null ? FormBuilder::CONTEXT_CREATE : FormBuilder::CONTEXT_EDIT)
			->build();

		return $this;
	}
356928
public function find($identifier)
    {
        $identifier = (string) $identifier;

        //Resolve the real identifier in case an alias was passed
        while(array_key_exists($identifier, $this->_aliases)) {
            $identifier = $this->_aliases[$identifier];
        }

        //Find the identifier
        if($this->offsetExists($identifier))
        {
            $result = $this->offsetGet($identifier);

            if($result instanceof KObjectInterface) {
                $result = $result->getIdentifier();
            }
        }
        else  $result = null;

        return $result;
    }
464600
public function isMultiton($identifier)
    {
        $result = false;
        $class  = $this->getClass($identifier);

        if($class) {
            $result = array_key_exists(__NAMESPACE__.'\ObjectMultiton', class_implements($class));
        }

        return $result;

    }
427733
public function onMixin(KObjectMixable $mixer)
    {
        parent::onMixin($mixer);

        //Set max age default
        if($this->isCacheable()) {
            $this->getMixer()->getResponse()->setMaxAge($this->getConfig()->cache_time, $this->getConfig()->cache_time_shared);
        }
    }
916743
public function getEntityByIdentifier($identifier)
    {
        $found_entities = $this->filter(
            function (EntityInterface $entity) use ($identifier) {
                return $entity->getIdentifier() === $identifier;
            }
        );

        return $found_entities->getFirst();
    }
394872
public function setIdentifier(Identifier $identifier)
    {
        if ($this->identifier !== null) {
            //TODO: throw exception
        }

        $this->identifier = $identifier;

        return $this;
    }