public function getClassesForPlace(Place $place)
 {
     $q = Doctrine_Query::create()->from('AbstractClass class')->where('class.place_id = ?', $place->getId());
     return $q->execute();
 }
示例#2
0
 public function testSetGetId()
 {
     $this->object->setId(123);
     $this->assertEquals(123, $this->object->getId());
 }
示例#3
0
 function test_confirmMeetUserTwo()
 {
     //Arrange
     $user_name = "Nathan";
     $password = "******";
     $latitude = 45.520969;
     $longitude = -122.679953;
     $signed_in = 1;
     $id = 1;
     $test_user = new User($user_name, $password, $longitude, $latitude, $signed_in, $id);
     $test_user->save();
     $user_name2 = "John";
     $password2 = "xxx";
     $latitude2 = 45.515852;
     $longitude2 = -122.674644;
     $signed_in2 = 1;
     $id2 = 1;
     $test_user2 = new User($user_name2, $password2, $longitude2, $latitude2, $signed_in2, $id2);
     $test_user2->save();
     $place_name = "Director Park";
     $address = "SW Park Ave";
     $longitude = 45.518672;
     $latitude = -122.681211;
     $id3 = 5;
     $test_place = new Place($place_name, $address, $longitude, $latitude, $id3);
     //Act
     $test_user->addMeetUpRequest($test_user2->getId(), $test_place->getId());
     $test_user2->confirmMeetupRequest($test_user->getId());
     $test_user2->confirmMeetUserTwo($test_user->getId(), $test_user2->getId(), true);
     $meetup_array = Meetup::getAll();
     $result = $meetup_array[0]->getConfirm_meet_usr2();
     //Assert
     $this->assertEquals(true, $result);
 }
示例#4
0
/**
 * Ссылка на добавление события
 *
 * @param Place $place
 */
function link_to_event_new($place = null)
{
    $args = $place ? array('place' => $place->getId()) : array();
    return link_to('Добавить событие', 'event_new', $args, array('class' => 'ajax event-new'));
}
示例#5
0
 function test_getId()
 {
     //Arrange
     $place_name = "Director Park";
     $address = "SW Park Ave";
     $latitude = 45.518672;
     $longitude = -122.681211;
     $id = 1;
     $test_place = new Place($place_name, $address, $latitude, $longitude, $id);
     //Act
     $result = $test_place->getId();
     //Assert
     $this->assertEquals($id, $result);
 }