JSON Serialise Method

Method for the \JsonSerializable Interface.
@return mixed
345282
public function jsonSerialize(){
		if($this->asValue() instanceof \DateTime){
			if($this->hasOption('format')){
				return $this->asValue()->format($this->options()->format);
			}else{
				if($this->hasOption('jsonnull') && $this->options()->jsonnull){
					return null;
				}
			}
		}

		if($this->hasOption('jsonnull') && $this->options()->jsonnull){
			return null;
		}
	}
822466
public function jsonSerialize()
    {
        // if formatting is requested, well then format baby!
        $config = $this->di->get('config');
        if ($config['application']['propertyFormatTo'] == 'none') {
            $attributes = $this->attributes;
        } else {
            $inflector = $this->di->get('inflector');
            $attributes = [];
            foreach ($this->attributes as $key => $value) {
                $attributes[$inflector->normalize($key,
                    $config['application']['propertyFormatTo'])] = $value;
            }
        }

        $result = [
            'id' => $this->id,
            'type' => $this->type,
            'attributes' => $attributes
        ];

        if ($this->relationships) {
            $result['relationships'] = $this->relationships;
        }

        return $result;
    }
840621
public function jsonSerialize()
    {
        return array_map(function($value)
        {
            if($value instanceof JsonSerialize)
                return $value->jsonSerialize();
            elseif($value instanceof  JsonInterface)
                return json_decode($value->toJson(), true);
            elseif($value instanceof ArrayInterface)
                return $value->toArray();
            else
                return $value;

        }, $this->attributes);
    }
553280
public function jsonSerialize() {
    return array(
      'iso'  =>       $this->format(DATE_RFC2822),
      'sql'  =>       $this->format('Y-m-d H:i:s.u'),
      'tz'   =>       $this->format('T'),
      'unix' => (int) $this->format('U'),
    );
  }
216399
public function jsonSerialize()
    {
        static $reflected, $callbacks;
        if (!isset($reflected, $callbacks)) {
            $annotations = $this->annotations();
            $refclass = new ReflectionClass($this);
            $reflected = [];
            $callbacks = [];
            foreach ($refclass->getProperties() as $prop) {
                if ($prop->isStatic()) {
                    continue;
                }
                if (!$prop->isPublic()) {
                    $anns = $annotations['properties'][$prop->getName()];
                    if ($prop->getName()[0] == '_' || isset($anns['Private'])) {
                        continue;
                    }
                }
                $reflected[] = $prop->getName();
            }
            foreach ($refclass->getMethods() as $method) {
                if (preg_match('@^get[A-Z]@', $method->getName())) {
                    $name = Helper::normalize(preg_replace(
                        '@^get@',
                        '',
                        $method->getName()
                    ));
                    $callbacks[$name] = $method->getName();
                }
            }
        }
        $json = new StdClass;
        foreach ($reflected as $prop) {
            $json->$prop = $this->$prop;
        }
        foreach ($callbacks as $name => $callback) {
            $json->$name = call_user_func([$this, $callback]);
        }
        foreach ($json as &$value) {
            if (is_object($value) && $value instanceof JsonSerializable) {
                $value = $value->jsonSerialize();
            }
        }
        return $json;
    }
233430
function jsonSerialize()
    {
        $result = [
            'title'        => $this->getTitle(),
            'link'         => $this->getLink(),
            'publicId'     => $this->getPublicId(),
            'description'  => $this->getDescription(),
            'lastModified' => $this->getLastModified()->format(\DateTime::ATOM),
            'url'          => $this->getUrl(),
            'items'        => $this->getItems(),
            'relations'    => $this->getRelations(),
        ];
        return $result;
    }
145824
public function jsonSerialize()
    {
        return [
            'message' => CustomAmqpMessage::getMessageProperties($this->message),
            'persistent' => $this->persistent,
            'mandatory' => $this->mandatory,
            'immediate' => $this->immediate
        ];
    }
1194247
public function serializeToJsonString()
    {
        $output = new CodedOutputStream($this->jsonByteSize());
        $this->serializeToJsonStream($output);
        return $output->getData();
    }
19847
public function jsonSerialize()
    {
        return [
            'id' => $this->id,
            'sequence' => $this->sequence,
            'batch_id' => $this->batchId,
            'type' => $this->type,
            'content' => $this->content,
            'tags' => $this->tags,
            'family_hash' => $this->familyHash,
            'created_at' => $this->createdAt->toDateTimeString(),
        ];
    }
350864
public function jsonSerialize()
    {
        return array(
            self::SOURCE_FACTORY => $this->metadataDaoFactory,
            self::FACTORY        => $this->driver,
            self::RESPONSE       => $this->response,
            self::UNIQUE_NAME    => $this->uniqueName,
        );
    }
1267346
public function jsonSerialize()
    {
        return [
            'id' => $this->id,
            'size' => $this->size,
            'link' => $this->link,
            'title' => $this->title,
            'caption' => $this->caption,
            'description' => $this->description,
            'type' => $this->type,
            'mimeType' => $this->mime_type,
            'meta' => $this->meta,
            'width' => $this->width,
            'height' => $this->height,
        ];
    }
1339844
public function jsonSerialize() {
        $ret = parent::jsonSerialize();
        $ret->id = $this->id;
        $ret->logicalConnectorWithNext = $this->logicalConnectorWithNext;
        $ret->negation = $this->negation;
        $ret->groupedWith = $this->groupedWith;

        return $ret;
    }
712258
public function jsonSerialize()
    {
        if (! Norm::options('include')) {
            return $this->toArray();
        }

        $destination = array();
        $source =  $this->toArray();

        $schema = $this->collection->schema();

        foreach ($source as $key => $value) {
            if (isset($schema[$key]) and isset($value)) {
                $destination[$key] = $schema[$key]->toJSON($value);
            } else {
                $destination[$key] = $value;
            }

            $destination[$key] = JsonKit::replaceObject($destination[$key]);
        }

        return $destination;
    }
1102704
public function jsonSerialize() {
		$vars = get_object_vars($this);
		unset($vars['keyProperties']);
		unset($vars['db']);
		unset($vars['loadedFromDb']);
		unset($vars['typeList']);
		unset($vars['cache']);
		unset($vars['errors']);

		return $vars;
	}
165052
public function jsonSerialize()
    {
        return [
            'agent' => $this->agent,
            'approved' => $this->approved,
            'author' => $this->author,
            'author_email' => $this->author_email,
            'author_ip' => $this->author_ip,
            'author_url' => $this->author_url,
            'content' => $this->content,
            'created_at' => $this->created_at,
            'id' => $this->id,
            'karma' => $this->karma,
            'parent_id' => $this->parent_id,
            'post_id' => $this->post_id,
            'replies' => $this->replies,
            'type' => $this->type,
            'user_id' => $this->user_id,
        ];
    }
149002
public function jsonSerialize()
    {
        return array_filter(
            [
                'enable' => $this->getEnable(),
                'email' => $this->getEmail()
            ],
            function ($value) {
                return $value !== null;
            }
        ) ?: null;
    }
576966
public function jsonSerialize()
    {
        // Encode in a way to decode in qcubed.js
        $a[Helper::JSON_OBJECT_TYPE] = 'qClosure';
        $a['func'] = $this->strBody;
        $a['params'] = $this->strParamsArray;
        return Helper::makeJsonEncodable($a);
    }