Example #1
0
 public function getObject($name)
 {
     $obj = grn_ctx_get($this->ctx, $name);
     if ($obj) {
         return new Object($obj);
     }
     return null;
 }
Example #2
0
 protected function fetchResource($value, Context $ctx = null)
 {
     if (is_object($value) && $value instanceof Object) {
         return $value->getResource();
     }
     if (is_scalar($value)) {
         if (!$ctx) {
             $ctx = $this->getContext();
         }
         if (is_int($value)) {
             return grn_ctx_at($ctx->getResource(), $value);
         }
         return grn_ctx_get($ctx->getResource(), $value);
     }
     return $value;
 }