Exemplo n.º 1
0
 /**
  * Figures out the desired type given the cast string ID.
  *
  * @param string $cast cast identifier
  *
  * @return integer
  *
  * @throws Security
  */
 private function getTypeFromCast($cast)
 {
     if ($cast == 'string') {
         $typeno = $this->writer->scanType('STRING');
     } elseif ($cast == 'id') {
         $typeno = $this->writer->getTypeForID();
     } elseif (isset($this->writer->sqltype_typeno[$cast])) {
         $typeno = $this->writer->sqltype_typeno[$cast];
     } else {
         throw new RedException('Invalid Cast');
     }
     return $typeno;
 }