public function insert() : Result
    {
        $result = self::getConnection()->insert($this);

        /*
         * In a successful insert operation, assign the new id to
         * current model.
         */
        if ($result->count()) {
            $pks = static::getPrimaryKeys();

            if (count($pks) == 1) {
                $this->data[$pks[0]] = static::getConnection()->lastId();
            }
        }

        return $result;
    }
public function insert() : Result
    {
        $result = self::getConnection()->insert($this);

        /*
         * In a successful insert operation, assign the new id to
         * current model.
         */
        if ($result->count()) {
            $pks = static::getPrimaryKeys();

            if (count($pks) == 1) {
                $this->data[$pks[0]] = static::getConnection()->lastId();
            }
        }

        return $result;
    }
public function insert ( ) : Result { $ result = self :: getConnection ( ) -> insert ( $ this ) ; /*
         * In a successful insert operation, assign the new id to
         * current model.
         */ if ( $ result -> count ( ) ) { $ pks = static :: getPrimaryKeys ( ) ; if ( count ( $ pks ) == 1 ) { $ this -> data [ $ pks [ 0 ] ] = static :: getConnection ( ) -> lastId ( ) ; } } return $ result ; }
Insert data in the database.

@return Result
Insert data in the database .