public function insertObject(DataObject $object, $skipID = true)
    {
        $data = [];

        foreach ($this->mapping as $column => $local) {
            if ($skipID && ($column == static::ID_COLUMN)) continue;

            $modifier = false;
            if (strpos($local, ':') !== false) {
                list($local, $modifier) = explode(':', $local);
            }

            if (!empty($object->$local)) {
                if (!empty($modifier) && is_object($this->$local)) {
                    switch ($modifier) {
                        case 'datetime':
                        case 'date':
                            $data[$column] = $object->$local->format('Y-m-d H:i:s');
                            break;

                        case 'timezone':
                            $data[$column] = $object->$local->getName();
                            break;
                    }
                } else {
                    $data[$column] = $object->$local;
                }
            }
        }

        if (!empty($data)) {
            

            $this->driver->insert(static::TABLE_NAME, $data);

            /**
             * @var \Slab\Database\Providers\MySQL\Provider $mysqlDriver
             */
            $mysqlDriver = $this->driver->getProvider();
            $object->{static::ID_COLUMN} = $mysqlDriver->insertId();

            return $object->{static::ID_COLUMN};
        }

        return false;
    }
public function insertObject(DataObject $object, $skipID = true)
    {
        $data = [];

        foreach ($this->mapping as $column => $local) {
            if ($skipID && ($column == static::ID_COLUMN)) continue;

            $modifier = false;
            if (strpos($local, ':') !== false) {
                list($local, $modifier) = explode(':', $local);
            }

            if (!empty($object->$local)) {
                if (!empty($modifier) && is_object($this->$local)) {
                    switch ($modifier) {
                        case 'datetime':
                        case 'date':
                            $data[$column] = $object->$local->format('Y-m-d H:i:s');
                            break;

                        case 'timezone':
                            $data[$column] = $object->$local->getName();
                            break;
                    }
                } else {
                    $data[$column] = $object->$local;
                }
            }
        }

        if (!empty($data)) {
            

            $this->driver->insert(static::TABLE_NAME, $data);

            /**
             * @var \Slab\Database\Providers\MySQL\Provider $mysqlDriver
             */
            $mysqlDriver = $this->driver->getProvider();
            $object->{static::ID_COLUMN} = $mysqlDriver->insertId();

            return $object->{static::ID_COLUMN};
        }

        return false;
    }
public function insertObject ( DataObject $ object , $ skipID = true ) { $ data = [ ] ; foreach ( $ this -> mapping as $ column => $ local ) { if ( $ skipID && ( $ column == static :: ID_COLUMN ) ) continue ; $ modifier = false ; if ( strpos ( $ local , ':' ) !== false ) { list ( $ local , $ modifier ) = explode ( ':' , $ local ) ; } if ( ! empty ( $ object -> $ local ) ) { if ( ! empty ( $ modifier ) && is_object ( $ this -> $ local ) ) { switch ( $ modifier ) { case 'datetime' : case 'date' : $ data [ $ column ] = $ object -> $ local -> format ( 'Y-m-d H:i:s' ) ; break ; case 'timezone' : $ data [ $ column ] = $ object -> $ local -> getName ( ) ; break ; } } else { $ data [ $ column ] = $ object -> $ local ; } } } if ( ! empty ( $ data ) ) { $ this -> driver -> insert ( static :: TABLE_NAME , $ data ) ; /**
             * @var \Slab\Database\Providers\MySQL\Provider $mysqlDriver
             */ $ mysqlDriver = $ this -> driver -> getProvider ( ) ; $ object -> { static :: ID_COLUMN } = $ mysqlDriver -> insertId ( ) ; return $ object -> { static :: ID_COLUMN } ; } return false ; }
Attempts to insert the object into the table

@param DataObject $object
@param boolean $skipID
@return bool|\Slab\Database\Providers\BaseResponse
Attempts to insert the object into the table