FactoryGirl\Provider\Doctrine\ORM\Locking\TableLockMode::toString PHP 메소드

toString() 공개 정적인 메소드

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

Usage Example

예제 #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