public function lock($request)
    {
        $id = (int)$request->postVar('RecordID');
        $class = $request->postVar('RecordClass');

        $existing = RecordBeingEdited::get()->filter(array(
            'RecordID' => $id,
            'RecordClass' => $class,
            'EditorID' => Member::currentUserID()
        ))->first();

        if ($existing) {
            $existing->write(false, false, true);
        } else {
            $lock = RecordBeingEdited::create(array(
                'RecordID' => $id,
                'RecordClass' => $class,
                'EditorID' => Member::currentUserID()
            ));
            $lock->write();
        }
    }
public function lock($request)
    {
        $id = (int)$request->postVar('RecordID');
        $class = $request->postVar('RecordClass');

        $existing = RecordBeingEdited::get()->filter(array(
            'RecordID' => $id,
            'RecordClass' => $class,
            'EditorID' => Member::currentUserID()
        ))->first();

        if ($existing) {
            $existing->write(false, false, true);
        } else {
            $lock = RecordBeingEdited::create(array(
                'RecordID' => $id,
                'RecordClass' => $class,
                'EditorID' => Member::currentUserID()
            ));
            $lock->write();
        }
    }
public function lock ( $ request ) { $ id = ( int ) $ request -> postVar ( 'RecordID' ) ; $ class = $ request -> postVar ( 'RecordClass' ) ; $ existing = RecordBeingEdited :: get ( ) -> filter ( array ( 'RecordID' => $ id , 'RecordClass' => $ class , 'EditorID' => Member :: currentUserID ( ) ) ) -> first ( ) ; if ( $ existing ) { $ existing -> write ( false , false , true ) ; } else { $ lock = RecordBeingEdited :: create ( array ( 'RecordID' => $ id , 'RecordClass' => $ class , 'EditorID' => Member :: currentUserID ( ) ) ) ; $ lock -> write ( ) ; } }
Handles ajax pings to create a RecordBeingEdited lock or update an existing one
Handles ajax pings to create a RecordBeingEdited lock or update an existing one