src/Charcoal/Source/Order.php
public function setData(array $data)
    {
        parent::setData($data);

        /** @deprecated */
        if (isset($data['string'])) {
            trigger_error(
                sprintf(
                    'Sort expression option "string" is deprecated in favour of "condition": %s',
                    $data['string']
                ),
                E_USER_DEPRECATED
            );
            $this->setCondition($data['string']);
        }

        /** @deprecated */
        if (isset($data['table_name'])) {
            trigger_error(
                sprintf(
                    'Sort expression option "table_name" is deprecated in favour of "table": %s',
                    $data['table_name']
                ),
                E_USER_DEPRECATED
            );
            $this->setTable($data['table_name']);
        }

        if (isset($data['table'])) {
            $this->setTable($data['table']);
        }

        if (isset($data['property'])) {
            $this->setProperty($data['property']);
        }

        if (isset($data['direction'])) {
            $this->setDirection($data['direction']);
        }

        if (isset($data['mode'])) {
            $this->setMode($data['mode']);
        }

        if (isset($data['values'])) {
            $this->setValues($data['values']);

            if (!isset($data['mode'])) {
                $this->setMode(self::MODE_VALUES);
            }
        }

        if (isset($data['condition']) || isset($data['string'])) {
            if (!isset($data['mode'])) {
                $this->setMode(self::MODE_CUSTOM);
            }
        }

        return $this;
    }
public function setData(array $data)
    {
        parent::setData($data);

        /** @deprecated */
        if (isset($data['string'])) {
            trigger_error(
                sprintf(
                    'Sort expression option "string" is deprecated in favour of "condition": %s',
                    $data['string']
                ),
                E_USER_DEPRECATED
            );
            $this->setCondition($data['string']);
        }

        /** @deprecated */
        if (isset($data['table_name'])) {
            trigger_error(
                sprintf(
                    'Sort expression option "table_name" is deprecated in favour of "table": %s',
                    $data['table_name']
                ),
                E_USER_DEPRECATED
            );
            $this->setTable($data['table_name']);
        }

        if (isset($data['table'])) {
            $this->setTable($data['table']);
        }

        if (isset($data['property'])) {
            $this->setProperty($data['property']);
        }

        if (isset($data['direction'])) {
            $this->setDirection($data['direction']);
        }

        if (isset($data['mode'])) {
            $this->setMode($data['mode']);
        }

        if (isset($data['values'])) {
            $this->setValues($data['values']);

            if (!isset($data['mode'])) {
                $this->setMode(self::MODE_VALUES);
            }
        }

        if (isset($data['condition']) || isset($data['string'])) {
            if (!isset($data['mode'])) {
                $this->setMode(self::MODE_CUSTOM);
            }
        }

        return $this;
    }
public function setData ( array $ data ) { parent :: setData ( $ data ) ; /** @deprecated */ if ( isset ( $ data [ 'string' ] ) ) { trigger_error ( sprintf ( 'Sort expression option "string" is deprecated in favour of "condition": %s' , $ data [ 'string' ] ) , E_USER_DEPRECATED ) ; $ this -> setCondition ( $ data [ 'string' ] ) ; } /** @deprecated */ if ( isset ( $ data [ 'table_name' ] ) ) { trigger_error ( sprintf ( 'Sort expression option "table_name" is deprecated in favour of "table": %s' , $ data [ 'table_name' ] ) , E_USER_DEPRECATED ) ; $ this -> setTable ( $ data [ 'table_name' ] ) ; } if ( isset ( $ data [ 'table' ] ) ) { $ this -> setTable ( $ data [ 'table' ] ) ; } if ( isset ( $ data [ 'property' ] ) ) { $ this -> setProperty ( $ data [ 'property' ] ) ; } if ( isset ( $ data [ 'direction' ] ) ) { $ this -> setDirection ( $ data [ 'direction' ] ) ; } if ( isset ( $ data [ 'mode' ] ) ) { $ this -> setMode ( $ data [ 'mode' ] ) ; } if ( isset ( $ data [ 'values' ] ) ) { $ this -> setValues ( $ data [ 'values' ] ) ; if ( ! isset ( $ data [ 'mode' ] ) ) { $ this -> setMode ( self :: MODE_VALUES ) ; } } if ( isset ( $ data [ 'condition' ] ) || isset ( $ data [ 'string' ] ) ) { if ( ! isset ( $ data [ 'mode' ] ) ) { $ this -> setMode ( self :: MODE_CUSTOM ) ; } } return $ this ; }
Set the order clause data.

@param  array<string,mixed> $data The expression data;
as an associative array.
@return self
Set the order clause data .