protected function isExists(array $value)
    {

        // validate fields by exist in tables

        foreach ($value as $table => $fields) {

            // load model metaData

            if ($this->isModel($table) === true) {
                $model = (new Manager())->load($table, new $table);

                // check fields of table

                $this->validColumns($model->getModelsMetaData(), $fields, $table, $model);

                // setup clear used tables
                $columnDefines = (new $table)->getReadConnection()->describeColumns($model->getSource());

                // add using tables with model alias
                $this->fields['tables'][$model->getSource()] = $table;

                // checking columns & fields

                foreach ($columnDefines as $column) {

                    if (in_array($column->getName(), $fields) === true) {
                        $this->validTypes($column);

                        // add column to table collection
                        $this->fields[$this->cast][$model->getSource()][$column->getName()] = $column->getType();
                    }
                }
            }
        }

        return true;
    }
protected function isExists(array $value)
    {

        // validate fields by exist in tables

        foreach ($value as $table => $fields) {

            // load model metaData

            if ($this->isModel($table) === true) {
                $model = (new Manager())->load($table, new $table);

                // check fields of table

                $this->validColumns($model->getModelsMetaData(), $fields, $table, $model);

                // setup clear used tables
                $columnDefines = (new $table)->getReadConnection()->describeColumns($model->getSource());

                // add using tables with model alias
                $this->fields['tables'][$model->getSource()] = $table;

                // checking columns & fields

                foreach ($columnDefines as $column) {

                    if (in_array($column->getName(), $fields) === true) {
                        $this->validTypes($column);

                        // add column to table collection
                        $this->fields[$this->cast][$model->getSource()][$column->getName()] = $column->getType();
                    }
                }
            }
        }

        return true;
    }
protected function isExists ( array $ value ) { // validate fields by exist in tables foreach ( $ value as $ table => $ fields ) { // load model metaData if ( $ this -> isModel ( $ table ) === true ) { $ model = ( new Manager ( ) ) -> load ( $ table , new $ table ) ; // check fields of table $ this -> validColumns ( $ model -> getModelsMetaData ( ) , $ fields , $ table , $ model ) ; // setup clear used tables $ columnDefines = ( new $ table ) -> getReadConnection ( ) -> describeColumns ( $ model -> getSource ( ) ) ; // add using tables with model alias $ this -> fields [ 'tables' ] [ $ model -> getSource ( ) ] = $ table ; // checking columns & fields foreach ( $ columnDefines as $ column ) { if ( in_array ( $ column -> getName ( ) , $ fields ) === true ) { $ this -> validTypes ( $ column ) ; // add column to table collection $ this -> fields [ $ this -> cast ] [ $ model -> getSource ( ) ] [ $ column -> getName ( ) ] = $ column -> getType ( ) ; } } } } return true ; }
Check if field exist in table

@param  array            $value
@throws ExceptionFactory
@return boolean
Check if field exist in table