public function setDataFor($arrValues)
    {
        $tableName = $this->getMetaModel()->getTableName();
        $colName   = $this->getColName();
        foreach ($arrValues as $id => $value) {
            if (null === $value) {
                // The sort key be can remove in later version.
                $value = ['bin' => [], 'value' => [], 'path' => [], 'sort' => null];
            }

            $files = ToolboxFile::convertValuesToDatabase($value);

            // Check single file or multiple file.
            if ($this->get('file_multiple')) {
                $files = \serialize($files);
            } else {
                $files = $files[0];
            }

            $this->connection->update(
                $this->quoteReservedWord($tableName),
                [$this->quoteReservedWord($colName) => $files],
                [$this->quoteReservedWord('id') => $id]
            );
        }
    }
public function setDataFor($arrValues)
    {
        $tableName = $this->getMetaModel()->getTableName();
        $colName   = $this->getColName();
        foreach ($arrValues as $id => $value) {
            if (null === $value) {
                // The sort key be can remove in later version.
                $value = ['bin' => [], 'value' => [], 'path' => [], 'sort' => null];
            }

            $files = ToolboxFile::convertValuesToDatabase($value);

            // Check single file or multiple file.
            if ($this->get('file_multiple')) {
                $files = \serialize($files);
            } else {
                $files = $files[0];
            }

            $this->connection->update(
                $this->quoteReservedWord($tableName),
                [$this->quoteReservedWord($colName) => $files],
                [$this->quoteReservedWord('id') => $id]
            );
        }
    }
public function setDataFor ( $ arrValues ) { $ tableName = $ this -> getMetaModel ( ) -> getTableName ( ) ; $ colName = $ this -> getColName ( ) ; foreach ( $ arrValues as $ id => $ value ) { if ( null === $ value ) { // The sort key be can remove in later version. $ value = [ 'bin' => [ ] , 'value' => [ ] , 'path' => [ ] , 'sort' => null ] ; } $ files = ToolboxFile :: convertValuesToDatabase ( $ value ) ; // Check single file or multiple file. if ( $ this -> get ( 'file_multiple' ) ) { $ files = \ serialize ( $ files ) ; } else { $ files = $ files [ 0 ] ; } $ this -> connection -> update ( $ this -> quoteReservedWord ( $ tableName ) , [ $ this -> quoteReservedWord ( $ colName ) => $ files ] , [ $ this -> quoteReservedWord ( 'id' ) => $ id ] ) ; } }
This method is called to store the data for certain items to the database.

@param mixed $arrValues The values to be stored into database. Mapping is item id=>value.

@return void
This method is called to store the data for certain items to the database .