eZ\Publish\Core\REST\Common\Output\Generator\Json::startObjectElement PHP Method

startObjectElement() public method

Start object element.
public startObjectElement ( string $name, string $mediaTypeName = null )
$name string
$mediaTypeName string
    public function startObjectElement($name, $mediaTypeName = null)
    {
        $this->checkStartObjectElement($name);
        $this->isEmpty = false;
        $mediaTypeName = $mediaTypeName ?: $name;
        $object = new Json\Object($this->json);
        if ($this->json instanceof Json\ArrayObject) {
            $this->json[] = $object;
            $this->json = $object;
        } else {
            $this->json->{$name} = $object;
            $this->json = $object;
        }
        $this->startAttribute('media-type', $this->getMediaType($mediaTypeName));
        $this->endAttribute('media-type');
    }