Пример #1
0
 public function getAssociatedPincho()
 {
     $target = PinchoMapper::getPinchoByIdemail($this->idemail);
     if (isset($target)) {
         return new Pincho($target["idnombre"], $target["descripcion"], $target["precio"], $target["ingredientes"], $target["ganadorPopular"], $target["estadoPropuesta"], $target["rutaimagen"]);
     } else {
         return NULL;
     }
 }
Пример #2
0
function isProbado($pinchoid, $userid)
{
    return PinchoMapper::isProbado($pinchoid, $userid);
}
Пример #3
0
 public static function getPinchoFromCode($code)
 {
     return Pincho::getByIdnombre(PinchoMapper::getPinchoIdFromCode($code));
 }
Пример #4
0
 public static function toggleMarcado($pinchoid, $userid)
 {
     global $connectHandler;
     if (PinchoMapper::isProbado($pinchoid, $userid)) {
         $query = "DELETE FROM probado WHERE pincho_idnombre = '{$pinchoid}' AND juradopopular_idemail = '{$userid}';";
     } else {
         $query = "INSERT INTO probado (pincho_idnombre, juradopopular_idemail) VALUES ('{$pinchoid}','{$userid}');";
     }
     if (mysqli_query($connectHandler, $query)) {
         return true;
     } else {
         return false;
     }
 }