Closed LuisFon87 closed 7 years ago
The message is pretty clear...
"Error: Class CalendarBundle\Entity\MyCompanyEvents has no field or association named event_datetime"
ok but now i got an Array empty with this query
$companyEvents = $this->entityManager->getRepository('CalendarBundle:MyCompanyEvents') ->createQueryBuilder('company_events') ->where('company_events.title BETWEEN :startDate and :endDate') ->setParameter('startDate', $startDate->format('Y-m-d H:i:s')) ->setParameter('endDate', $endDate->format('Y-m-d H:i:s')) ->getQuery()->getResult();
I have this
and dont show nothing... where is my error? thanks
You're searching on title and not a date. Closing this issue as this is no longer in scope of this bundle.
On Mon, Jan 23, 2017, 5:08 PM LuisFon87 notifications@github.com wrote:
ok but now i got an Array empty with this query
$companyEvents = $this->entityManager->getRepository('CalendarBundle:MyCompanyEvents') ->createQueryBuilder('company_events') ->where('company_events.title BETWEEN :startDate and :endDate') ->setParameter('startDate', $startDate->format('Y-m-d H:i:s')) ->setParameter('endDate', $endDate->format('Y-m-d H:i:s')) ->getQuery()->getResult();
I have this [image: captura] https://cloud.githubusercontent.com/assets/25245075/22224924/be1a77e8-e1c0-11e6-85c0-87c4a3e89ab9.JPG
and dont show nothing... where is my error? thanks
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adesigns/calendar-bundle/issues/53#issuecomment-274633318, or mute the thread https://github.com/notifications/unsubscribe-auth/AA77WLzL16MnhK2yUWLfrr6eG2XPhiGJks5rVSTkgaJpZM4LpPgL .
@LuisFon87 Where do you add the events. I've managed to show the calendar but I don't find the location to add any events. A Doctrine update of my database in my project does not change a thing.
I did everything from readme, but I have a problem with Add events. I want to know how to connect with the database. I got this error
[Semantical Error] line 0, col 101 near 'event_datetime': Error: Class CalendarBundle\Entity\MyCompanyEvents has no field or association named event_datetime
My entity: <?php
namespace CalendarBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
@ORM\Entity(repositoryClass="CalendarBundle\Repository\EventEntityRepository") */ class MyCompanyEvents { /**
@ORM\GeneratedValue(strategy="AUTO") */ protected $id;
protected $title;
/**
/**
/**
/**
/**
/**
/**
public function __construct($title, \DateTime $startDatetime, \DateTime $endDatetime = null, $allDay = false) { $this->title = $title; $this->startDatetime = $startDatetime; $this->setAllDay($allDay);
} /**
@return array $event */ public function toArray() { $event = array();
if ($this->id !== null) { $event['id'] = $this->id; }
$event['title'] = $this->title; $event['start'] = $this->startDatetime->format("Y-m-d\TH:i:sP");
if ($this->url !== null) { $event['url'] = $this->url; }
if ($this->bgColor !== null) { $event['backgroundColor'] = $this->bgColor; $event['borderColor'] = $this->bgColor; }
if ($this->fgColor !== null) { $event['textColor'] = $this->fgColor; }
if ($this->cssClass !== null) { $event['className'] = $this->cssClass; } if ($this->endDatetime !== null) { $event['end'] = $this->endDatetime->format("Y-m-d\TH:i:sP"); }
$event['allDay'] = $this->allDay; foreach ($this->otherFields as $field => $value) { $event[$field] = $value; }
return $event; } public function setId($id) { $this->id = $id; }
public function getId() { return $this->id; }
public function setTitle($title) { $this->title = $title; }
public function getTitle() { return $this->title; } public function setUrl($url) { $this->url = $url; }
public function getUrl() { return $this->url; }
public function setBgColor($color) { $this->bgColor = $color; }
public function getBgColor() { return $this->bgColor; }
public function setFgColor($color) { $this->fgColor = $color; }
public function getFgColor() { return $this->fgColor; }
public function setCssClass($class) { $this->cssClass = $class; }
public function getCssClass() { return $this->cssClass; }
public function setStartDatetime(\DateTime $start) { $this->startDatetime = $start; }
public function getStartDatetime() { return $this->startDatetime; }
public function setEndDatetime(\DateTime $end) { $this->endDatetime = $end; }
public function getEndDatetime() { return $this->endDatetime; }
public function setAllDay($allDay = false) { $this->allDay = (boolean) $allDay; }
public function getAllDay() { return $this->allDay; } /**