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; } }
function isProbado($pinchoid, $userid) { return PinchoMapper::isProbado($pinchoid, $userid); }
public static function getPinchoFromCode($code) { return Pincho::getByIdnombre(PinchoMapper::getPinchoIdFromCode($code)); }
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; } }