Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Main;
- class NewsRepository extends Repository {
- /**
- * Vybratie všetkých noviniek
- * @return Nette\Database\Table\Selection
- */
- public function getAllNews() {
- return $this->getTable()->order('date DESC');
- }
- /**
- * Pridanie novinky
- * @return Nette\Database\Table\Selection
- */
- public function addNews($data, $user) {
- $data['date'] = new \DateTime();
- $data['author'] = $user;
- return $this->getTable()->insert($data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment