Serialize

@return string
482068
public function serialize()
    {
        $clone = clone $this;

        $clone->setExtractFlags(self::EXTR_BOTH);

        $data = [];

        foreach ($clone as $item) {
            $data[] = $item;
        }

        return serialize($data);
    }
945578
public function serialize()
    {
        return json_encode(array(
            'data' => $this->data,
            'this' => $this->getArrayCopy(),
            'name' => $this->name,
            'merged' => $this->merged,
        ));
    }
1242771
public function serialize()
    {
        if ($this->manager) {
            return serialize([
                'pageId' => $this->getPage()->getId(),
                'snapshotId' => $this->snapshot->getId(),
            ]);
        }

        return serialize([]);
    }
282746
public function serialize()
    {
        return serialize(array(
            $this->id,
            $this->email,
            $this->firstName,
            $this->lastName,
            $this->locale,
            $this->timezone,
            $this->gender,
            $this->country,
            $this->phone,
            $this->pictureUrl,
        ));
    }
264695
public function serialize()
    {
        return json_encode([
            'operation_name' => $this->operationName,
            'channel' => $this->channel,
            'args' => $this->args,
            'context' => $this->contextSerializer()->serialize($this->context),
            'query' => serialize(
                AST::toArray($this->query)
            ),
        ]);
    }
22097
public function serialize()
	{
		return serialize( array( $this->message, $this->code, $this->file, $this->line, $this->errors, $this->form ) );
	}
832781
public function serialize()
    {
        $data = array(
            // Serialized data ID.
            self::VERSION,
            $this->_bytes,
            $this->_eol,
            $this->_hdrCharset,
            $this->_headers,
            $this->_metadata,
            $this->_mimeid,
            $this->_parts,
            $this->_status,
            $this->_transferEncoding
        );

        if (!empty($this->_contents)) {
            $data[] = $this->_readStream($this->_contents);
        }

        return serialize($data);
    }
907597
final public function serialize(): string
    {
        $vars = array_filter(get_object_vars($this));
        $vars['adviceMethod'] = static::serializeAdvice($this->adviceMethod);

        return serialize($vars);
    }
1066950
public function serialize()
    {
        $data = array();

        $skip = array(
            'connection',
            'platform',
            'driver'
        );

        foreach ($this as $key => $value) {
            if (in_array($key, $skip)) {
                continue;
            }
            $data[$key] = $value;
        }

        return serialize($data);
    }
74085
public function serialize()
    {
        return serialize(array(
            $this->mask,
            $this->id,
            $this->securityIdentity,
            $this->strategy,
            $this->auditFailure,
            $this->auditSuccess,
            $this->granting,
        ));
    }
1174994
public function serialize()
    {
        $data = array(
            'coverage'      => $this->coverage,
            'filter'        => $this->filter,
            'options'       => $this->options,
            'path'          => $this->path,
        );

        return serialize($data);
    }
1331155
public function serialize()
    {
        $ns_string = '';
        foreach ($this->namespaces as $k => $v) {
            $ns_string .= "\n  xmlns:$k=\"$v\"";
        }
        $return_msg =
            '<?xml version="1.0" encoding="' . $this->soap_defencoding . '"?>' .
            '<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"' . $ns_string . ">\n" .
            '<SOAP-ENV:Body>' .
            '<SOAP-ENV:Fault>' .
            $this->serialize_val($this->faultcode, 'faultcode') .
            $this->serialize_val($this->faultactor, 'faultactor') .
            $this->serialize_val($this->faultstring, 'faultstring') .
            $this->serialize_val($this->faultdetail, 'detail') .
            '</SOAP-ENV:Fault>' .
            '</SOAP-ENV:Body>' .
            '</SOAP-ENV:Envelope>';
        return $return_msg;
    }
159744
public function toString()
    {
        $headers = $this->toArray();
        $content = '';

        //Serialise the headers to a string
        foreach ($headers as $name => $value) {
            $content .= sprintf("%s %s\r\n", $name.':', $value);
        }

        return $content;
    }
363917
public function serialize() {
		return $this->map(function( $element ) {
			if ( $element instanceof Serializes ) {
				return $element->serialize();
			}

			return $element;
		} )->to_array();
	}
1212045
protected function serialize() {
    if (!$this->isModified() && ($cacheFile = $this->getSerializeFilename($this->addedFiles))) {
      if (self::$logger->isDebugEnabled()) {
        self::$logger->debug("Serialize configuration: ".join(',', $this->addedFiles)." to file: ".$cacheFile);
      }
      $this->fileUtil->mkdirRec(dirname($cacheFile));
      if ($fh = @fopen($cacheFile, "w")) {
        if (@fwrite($fh, serialize(array_filter(get_object_vars($this), function($value, $name) {
          return $name != 'comments'; // don't store comments
        }, ARRAY_FILTER_USE_BOTH)))) {
          @fclose($fh);
        }
      }
    }
  }
224129
public function serialize() {
		$attributes = array();

		if ( $this->visible ) {
			// If visible attributes are set, we'll only reveal those.
			foreach ( $this->visible as $key ) {
				$attributes[ $key ] = $this->get_attribute( $key );
			}
		} elseif ( $this->hidden ) {
			// If hidden attributes are set, we'll grab everything and hide those.
			foreach ( $this->get_attribute_keys() as $key ) {
				if ( ! in_array( $key, $this->hidden ) ) {
					$attributes[ $key ] = $this->get_attribute( $key );
				}
			}
		} else {
			// If nothing is hidden/visible, we'll grab and reveal everything.
			foreach ( $this->get_attribute_keys() as $key ) {
				$attributes[ $key ] = $this->get_attribute( $key );
			}
		}

		return array_map( function ( $attribute ) {
			if ( $attribute instanceof Serializes ) {
				return $attribute->serialize();
			}

			return $attribute;
		}, $attributes );
	}
1017672
public function serialize()
    {
        $result = [
            'code' => $this->getCode(),
            'message' => $this->getMessage(),
            'errors' => $this->getErrors()
        ];

        $result['data'] = $this->getVariables();

        if ($result['data'] instanceof Traversable) {
            $result['data'] = ArrayUtils::iteratorToArray($result['data']);
        }

        if (null !== $this->jsonpCallback) {
            return $this->jsonpCallback . '(' . Json::encode($result) . ');';
        }

        return Json::encode($result);
    }