Railsbin – The vulnerable pastebin service!

User:

Title: GDO stuff

Content:

<?php
namespace GDO\LinkUUp;

use GDO\Core\GDO;
use GDO\User\GDO_User;
use GDO\User\GDT_User;
use GDO\Maps\GDT_Position;

/**
 * Record last user GPS.
 */
final class LUP_SignupGPS extends GDO
{
    ###########
    ### GDO ###
    ###########
    public function gdoCached() { return false; }
    public function gdoColumns()
    {
        return array(
            GDT_User::make('lsp_user')->primary(),
            GDT_Position::make('lsp_pos')->notNull(),
        );
    }
    
    ###########
    ### API ###
    ###########
    public static function updateGPS(GDO_User $user, $lat, $lng)
    {
        return self::blank(array(
            'lsp_user' => $user->getID(),
            'lsp_pos_lat' => $lat,
            'lsp_pos_lng' => $lng,
        ))->replace();
    }
    

}

Edit | Back