<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/documentai/v1/document.proto

namespace Google\Cloud\DocumentAI\V1\Document\Page\Table;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A cell representation inside the table.
 *
 * Generated from protobuf message <code>google.cloud.documentai.v1.Document.Page.Table.TableCell</code>
 */
class TableCell extends \Google\Protobuf\Internal\Message
{
    /**
     * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
     * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.Document.Page.Layout layout = 1;</code>
     */
    private $layout = null;
    /**
     * How many rows this cell spans.
     *
     * Generated from protobuf field <code>int32 row_span = 2;</code>
     */
    private $row_span = 0;
    /**
     * How many columns this cell spans.
     *
     * Generated from protobuf field <code>int32 col_span = 3;</code>
     */
    private $col_span = 0;
    /**
     * A list of detected languages together with confidence.
     *
     * Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4;</code>
     */
    private $detected_languages;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DocumentAI\V1\Document\Page\Layout $layout
     *           [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
     *           [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
     *     @type int $row_span
     *           How many rows this cell spans.
     *     @type int $col_span
     *           How many columns this cell spans.
     *     @type array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $detected_languages
     *           A list of detected languages together with confidence.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce();
        parent::__construct($data);
    }

    /**
     * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
     * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.Document.Page.Layout layout = 1;</code>
     * @return \Google\Cloud\DocumentAI\V1\Document\Page\Layout|null
     */
    public function getLayout()
    {
        return $this->layout;
    }

    public function hasLayout()
    {
        return isset($this->layout);
    }

    public function clearLayout()
    {
        unset($this->layout);
    }

    /**
     * [Layout][google.cloud.documentai.v1.Document.Page.Layout] for
     * [TableCell][google.cloud.documentai.v1.Document.Page.Table.TableCell].
     *
     * Generated from protobuf field <code>.google.cloud.documentai.v1.Document.Page.Layout layout = 1;</code>
     * @param \Google\Cloud\DocumentAI\V1\Document\Page\Layout $var
     * @return $this
     */
    public function setLayout($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\Page\Layout::class);
        $this->layout = $var;

        return $this;
    }

    /**
     * How many rows this cell spans.
     *
     * Generated from protobuf field <code>int32 row_span = 2;</code>
     * @return int
     */
    public function getRowSpan()
    {
        return $this->row_span;
    }

    /**
     * How many rows this cell spans.
     *
     * Generated from protobuf field <code>int32 row_span = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setRowSpan($var)
    {
        GPBUtil::checkInt32($var);
        $this->row_span = $var;

        return $this;
    }

    /**
     * How many columns this cell spans.
     *
     * Generated from protobuf field <code>int32 col_span = 3;</code>
     * @return int
     */
    public function getColSpan()
    {
        return $this->col_span;
    }

    /**
     * How many columns this cell spans.
     *
     * Generated from protobuf field <code>int32 col_span = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setColSpan($var)
    {
        GPBUtil::checkInt32($var);
        $this->col_span = $var;

        return $this;
    }

    /**
     * A list of detected languages together with confidence.
     *
     * Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDetectedLanguages()
    {
        return $this->detected_languages;
    }

    /**
     * A list of detected languages together with confidence.
     *
     * Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Page.DetectedLanguage detected_languages = 4;</code>
     * @param array<\Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDetectedLanguages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page\DetectedLanguage::class);
        $this->detected_languages = $arr;

        return $this;
    }

}


