FactoryGirl\Provider\Doctrine\ORM\Locking\TableLockMode::toString PHP Method

toString() public static method

public static toString ( integer $mode ) : null | string
$mode integer
return null | string
    public static function toString($mode)
    {
        switch ($mode) {
            case self::READ:
                return 'READ';
            case self::WRITE:
                return 'WRITE';
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Get the MySQL statement for locking the table underlying this repository
  * for simple read and/or write operations given an appropriate lock mode
  * 
  * @param int $lockMode a TableLockMode constant
  * @return string
  * @throws LockException
  */
 private function getLockString($lockMode)
 {
     $lockModeString = TableLockMode::toString($lockMode);
     if (!$lockModeString) {
         throw new LockException("Invalid lock mode: {$lockMode}");
     }
     $tableName = $this->getTableName();
     $aliases = $this->getTableAliasGuesstimates($tableName);
     return $this->constructLockString($tableName, $aliases, $lockModeString);
 }
TableLockMode