Search in sources :

Example 1 with Getter

use of php.runtime.annotation.Reflection.Getter in project jphp by jphp-compiler.

the class ODocument method getId.

@Getter
public String getId() {
    ORID identity = getWrappedObject().getIdentity();
    if (identity.isNew()) {
        return null;
    }
    StringBuilder buffer = new StringBuilder();
    return identity.toString(buffer).toString();
}
Also used : ORID(com.orientechnologies.orient.core.id.ORID) Getter(php.runtime.annotation.Reflection.Getter)

Example 2 with Getter

use of php.runtime.annotation.Reflection.Getter in project jphp by jphp-compiler.

the class PWebRequest method getCookies.

@Getter
public Memory getCookies() {
    Cookie[] cookies = getWrappedObject().getCookies();
    ArrayMemory result = new ArrayMemory();
    if (cookies != null) {
        for (Cookie cookie : cookies) {
            ArrayMemory item = new ArrayMemory();
            item.refOfIndex("name").assign(cookie.getName());
            item.refOfIndex("value").assign(cookie.getValue());
            item.refOfIndex("path").assign(cookie.getPath());
            item.refOfIndex("domain").assign(cookie.getDomain());
            item.refOfIndex("maxAge").assign(cookie.getMaxAge());
            item.refOfIndex("httpOnly").assign(cookie.isHttpOnly());
            item.refOfIndex("secure").assign(cookie.getSecure());
            item.refOfIndex("comment").assign(cookie.getComment());
            result.add(item);
        }
    }
    return result.toConstant();
}
Also used : Cookie(javax.servlet.http.Cookie) ArrayMemory(php.runtime.memory.ArrayMemory) Getter(php.runtime.annotation.Reflection.Getter)

Aggregations

Getter (php.runtime.annotation.Reflection.Getter)2 ORID (com.orientechnologies.orient.core.id.ORID)1 Cookie (javax.servlet.http.Cookie)1 ArrayMemory (php.runtime.memory.ArrayMemory)1