Category : repository-pattern

I have a dynamic component that loads it based on the type of each component and props that I passed are used inside all the components <div> <component :is="getComponentName(attribute.type.toLowerCase())" :cell-value="listItem[attribute.name]" :attribute="attribute" :is-read-only="isReadOnly" :row-key-id="listItem.keyId" /> </div> and components are loaded from within a json where each type is assigned a component { "dropdown" : { "shouldLoadComponent" ..

Read more

I recently got aware of repository pattern. I am quite new to this pattern and tried to shift my code in this patter. I am using Node js and Sequelize ORM with Sqlite database. Following route is working router.get(‘/listquestions’,(req,res)=>{ Question.findAll({ attributes: [‘id’,’title’], include: [{ model:Lecture, attributes: [‘id’,’videoname’,’coursecode’], }] }).then((questions) => { if(questions){ console.log(JSON.stringify(questions)); res.render(‘pages/questionslist’, {data:questions}); ..

Read more

I started an vuejs app and I have a very strange error. I used this tutorial : https://www.telerik.com/blogs/10-good-practices-building-maintaining-large-vuejs-projects So I have my repository file called /repositories/index.js : import RequestClient from ‘.requestClient’; import User from ‘./user’; const repositories = { user: User(RequestClient), }; export default { get: name => repositories[name] }; Now I use this repository ..

Read more

I have a repository plugged to a model TimeSlot. I have created a criteria to get timeslots of a given restaurant. Here is the criteria <?php namespace AppCriteriaTimeSlots; use PrettusRepositoryContractsCriteriaInterface; use PrettusRepositoryContractsRepositoryInterface; /** * Class TimeSlotsOfRestaurantCriteria. * * @package namespace AppCriteriaTimeSlots; */ class TimeSlotsOfRestaurantCriteria implements CriteriaInterface { /** * @var int */ private $restaurantId; /** ..

Read more