コード例 #1
0
 /**
  * Sets all the primary columns in a table (there should only be one anyway)
  *
  * @param $table_columns
  */
 public function SetPrimary($table_columns)
 {
     /**
      * You can set a primary instance by putting a '*' at the end of the column name
      */
     foreach ($table_columns as $key => $value) {
         /**
          * Great, we found a primary!
          */
         if (String::GetLast($key) == '*') {
             /**
              * Returns the full string minus the last character.
              */
             $value = String::RemoveLast($key);
             /**
              * Now lets set this as a primary!
              */
             $this->blueprint->primary($value);
         }
     }
 }