Mixin an object

@param   object  An object that implements KMinxInterface
@return  AnObject
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);
    }
1365718
public static function fromObject($object){
        $issue = new \sb\Gitlab\P();
        foreach(get_object_vars($object) as $k=>$v){
           
            switch($k){
                case 'assignee':
                case 'author':
                    if(!is_object($v)){
                        $issue->{$k} = $v;
                        break;
                    }
                    $user = new \sb\Gitlab\User();
                    foreach(get_object_vars($v) as $uk=>$uv){
                        $user->{$uk} = $uv;
                    }
                    $issue->{$k} = $user;
                    break;

                default:
                    $issue->{$k} = $v;
            }
                
        }
        
        return $issue;
    }
782714
@Override
    public Object replaceObject(Object object) {
        if (object instanceof HibernateProxy) {
            return ((HibernateProxy) object).getHibernateLazyInitializer().getImplementation();
        }
        return object;
    }
123119
public function prune($object = null)
    {
        if ($object) {
            $this->addUsingAlias(ObjectTableMap::COL_ID, $object->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
820985
public static function createFromObject($object)
    {
        if ($object instanceof ObjectIdentity) {
            return new static($object->getIdentifier());
        }
        
        $name = get_class($object);
        $hash = static::getObjectHash($object, 'sha256');
        
        $identifier = sprintf('%s@%s', $name, $hash);
        
        return new static($identifier, $name);
    }
284828
public static function toObject( $object )
    {
        //	If we can't iterate over the thing, we bail
        if ( !is_object( $object ) && !is_array( $object ) && !( $object instanceof \Traversable ) )
        {
            return null;
        }

        if ( is_array( $object ) )
        {
            //	Convert to an object
            $_properties = new \stdClass();

            foreach ( $object as $_key => $_value )
            {
                $_properties->{$_key} = $_value;
            }
        }
        else
        {
            $_me = new \ReflectionObject( $object );
            $_properties = $_me->getProperties();
        }

        //	We'll return this
        $_obj = new \stdClass();

        if ( !empty( $_properties ) )
        {
            if ( is_object( $object ) )
            {
                $_myClass = get_class( $object );
            }
            else
            {
                $_myClass = '_array_';
            }

            foreach ( $_properties as $_property )
            {
                //	Only want properties of $object hierarchy...
                if ( isset( $_property->class ) )
                {
                    $_class = new \ReflectionClass( $_property->class );

                    if ( !empty( $_class ) && !$_class->isInstance( $object ) && !$_class->isSubclassOf( $_myClass ) )
                    {
                        unset( $_class );
                        continue;
                    }

                    unset( $_class );
                }

                try
                {
                    $_realPropertyName = $_propertyName = ltrim( $_property->name, '_ ' );

                    if ( false !== strpos( $_propertyName, '_' ) )
                    {
                        $_propertyName = Inflector::tag( $_propertyName );
                    }

                    $_getter = 'get' . $_propertyName;

                    if ( method_exists( $object, $_getter ) )
                    {
                        $_propertyValue = $object->{$_getter}();

                        if ( !is_scalar( $_propertyValue ) )
                        {
                            $_propertyValue = self::toObject( $_propertyValue );
                        }

                        $_obj->{$_realPropertyName} = $_propertyValue;
                    }
                }
                catch ( \Exception $_ex )
                {
                    //	Just ignore, not a valid property if we can't read it with a getter
                }
            }
        }

        return $_obj;
    }
1321636
public function readObject($object = null)
    {
        if ($object === null) {
            $object = array();
        }

        while (true) {
            $key        = $this->_stream->readUTF();
            $typeMarker = $this->_stream->readByte();
            if ($typeMarker != Zend_Amf_Constants::AMF0_OBJECTTERM ){
                //Recursivly call readTypeMarker to get the types of properties in the object
                $object[$key] = $this->readTypeMarker($typeMarker);
            } else {
                //encountered AMF object terminator
                break;
            }
        }
        $this->_reference[] = $object;
        return (object) $object;
    }
71386
private function copyObject($object)
  {
    $objectHash = spl_object_hash($object);

    if (isset($this->hashMap[$objectHash])) {
      return $this->hashMap[$objectHash];
    }

    $reflectedObject = new \ReflectionObject($object);

    if (false === $isCloneable = $reflectedObject->isCloneable() and $this->skipUncloneable) {
      $this->hashMap[$objectHash] = $object;
      return $object;
    }

    if (false === $isCloneable) {
      throw new \UnexpectedValueException(sprintf(
          'Class "%s" is not cloneable.',
          $object->getName()
      ));
    }

    $newObject = clone $object;
    $this->hashMap[$objectHash] = $newObject;

    foreach ($reflectedObject->getProperties() as $property) {
      $this->copyObjectProperty($newObject, $property);
    }

    return $newObject;
  }
392987
protected function createObject($object)
    {
        $type = new ObjectType(['class'=>get_class($object)]);

        foreach (get_object_vars($object) as $property=>$value) {
            $type[$property] = $this->toType($value);
        }

        return $type;
    }
395535
static public function factory($object)
    {
        if (!isset($object->type)) {
            throw new ObjectException('The object has no type.');
        }

        $type = (string)$object->type;
        if (!isset(self::$types[$type])) {
            throw new NoSupportException(sprintf('The object type "%s" is unknown or invalid.', $type));
        }

        $class = '\\Omlex\\Object\\'.self::$types[$type];
        if (!class_exists($class)) {
            throw new ObjectException(sprintf('The object class "%s" is invalid or not found.', $class));
        }

        $instance = new $class($object);
        return $instance;
    }
468971
public static <T> Map<String, Object> transformToMap(T object) {
        return transform(object, MAP_TYPE_REFERENCE);
    }
887836
protected function adder($object)
    {
        $rel = $this;

        return function($value) use ($object, $rel) {
            return $rel->add($object, $value);
        };
    }
1286404
public static function createFromObject($object)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('Object was expected.');
        }

        $className = get_class($object);

        return new self($className);
    }
688127
private function normalizeObject($object) : Expr\FuncCall
    {
        if ($object instanceof InjectorInterface) {
            return new Expr\FuncCall(new Expr\Variable('injector'));
        }
        $serialize = new Scalar\String_(\serialize($object));

        return new Expr\FuncCall(new Node\Name('unserialize'), [new Arg($serialize)]);
    }
36753
public static <T> T copy(final T object) {
		if (object == null) return null;
		TypeEnum type = TypeEnum.dataTypeOf(object.getClass());
		return copy(object, type);
	}
266503
public static function set($object, $key = null) {
        if (!is_object($object)) {
            throw new InvalidObjectException('The object to register must be instantiated');
        }

        if (!$key) {
            $key = get_class($object);
        }

        static::$_registered[$key] = $object;

        return $object;
    }
960968
public static function from($object): self
    {
        if ($object instanceof self) {
            return $object;
        }

        if (\is_object($object)) {
            $object = \get_class($object);
        }

        if (! \is_string($object)) {
            throw new InvalidArgumentException('Cannot create a type from '.\gettype($object));
        }

        return new self($object);
    }