src/LockAware.php
public function setLock(Lock $lock)
    {
        // Make sure that the subject from the given lock instance is this object.
        if ($lock->getSubject() !== $this) {
            throw new InvalidLockInstance('Invalid Lock instance given for current object.');
        }

        $this->lock = $lock;
    }
public function setLock(Lock $lock)
    {
        // Make sure that the subject from the given lock instance is this object.
        if ($lock->getSubject() !== $this) {
            throw new InvalidLockInstance('Invalid Lock instance given for current object.');
        }

        $this->lock = $lock;
    }
public function setLock ( Lock $ lock ) { // Make sure that the subject from the given lock instance is this object. if ( $ lock -> getSubject ( ) !== $ this ) { throw new InvalidLockInstance ( 'Invalid Lock instance given for current object.' ) ; } $ this -> lock = $ lock ; }
Sets the lock instance for this caller

@param \BeatSwitch\Lock\Lock $lock
@throws \BeatSwitch\Lock\InvalidLockInstance
Sets the lock instance for this caller