Skip to content

Commit

Permalink
add: IsDefault and IsNotDefault methods in VersionComponent.
Browse files Browse the repository at this point in the history
  • Loading branch information
nelson6e65 committed Feb 4, 2015
1 parent 66505ed commit d9d0571
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/VersionComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
/**
* Representa un componente de un número de Version.
* Extiende la clase IntString, pero restringe los valores que puede tomar.
*
*
*
*
* @package NelsonMartell
* @author Nelson Martell (@yahoo.es: nelson6e65-dev)
* */
Expand Down Expand Up @@ -78,5 +78,30 @@ public static function Parse($value) {
return $r;
}

/**
* Determina si este componente tiene los valores predeterminados (0).
*
*
* @return boolean
* */
public function IsDefault() {
if ($this->IntValue == 0){
if ($this->StringValue == '') {
return true;
}
}

return false;
}

/**
* Determina si este componente NO tiene los valores predeterminados.
*
*
* @return boolean
* */
public function IsNotDefault() {
return !$this->IsDefault();
}
}
}

0 comments on commit d9d0571

Please sign in to comment.