Exemplo n.º 1
0
 public function testGetName()
 {
     $state = new State('stateName', [], []);
     $this->assertEquals('stateName', $state->getName());
 }
Exemplo n.º 2
0
    echo $row['name'];
    ?>
 </option>
                                                    <?php 
}
?>
                                                </select>
                                            </div>
                                        </td>
                                    </tr>
                                    <?php 
$id = Request::get("id");
if (is_numeric($id) && $id > 0) {
    $stateObj = new State();
    $stateObj->set("state_id", $id);
    $result = $stateObj->getName();
    if (count($result)) {
        $row = $result[0];
        $state_id = $row['id'];
        $country_id = $row['country_id'];
        $state_name = $row['name'];
        $state_status = $row['active'];
    }
}
?>
                                    <tr>
                                        <td><label class="control-label" for="selectError">State</label></td>
                                        <td><div class="input-group" style="width: 50%">
                                                <span class="input-group-addon"></span>
                                                <input type="text" name="state_name" value="<?php 
echo $state_name;
 /**
  * Return if two state objects are equals
  * 
  * @param  State     $state1   State 1
  * @param  State     $state2   State 2
  * @return boolean             result
  */
 static function compareState($state1 = null, $state2 = null)
 {
     if ($state1 === null || $state2 === null) {
         return false;
     } else {
         if ($state1->getName() == $state2->getName() && $state1->getShortName() == $state2->getShortName() && $state1->getCountry() == $state2->getCountry()) {
             return true;
         } else {
             return false;
         }
     }
 }