Jump to content

blacktie524

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

blacktie524's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've got Xdebug properly installed, and it shows up with the proper php .ini config settings when I view my phpinfo(). However, I can't get it to work in Aptana Studio 1.5.1. Can anyone help guide me on getting this properly setup? I'm sooo excited to start using xdebug, but it's not working! Appreciate your help, thx!
  2. What actually happens in the background after php interpreter parses code that says, open a database connection, execute curl request, etc.? So when a php script is run and the php interpreter parses the script and finds code that says open a database connection and perform a query, how does this actually happen? What goes on in the background that actually fulfills this request and performs the communication with the database?
  3. Hi, I know this is a very basic question, but I sometimes find myself struggling to figure out when to split a single object method into multiple methods. For example, I am trying to set up an ACL using Zend_Acl and Zend_Auth, as shown in this tutorial: http://devzone.zend.com/article/1665. However, I am wondering if the My_Plugin_Auth::preDispatch() method should invoke calls to a method called authenticate() and a method called authorize(), instead of having everything lumped in under preDispatch(). I was thinking that this would make the code more readable and encapsulate the logic into its smaller parts, but i'm not sure if this is reason enough.
  4. Wouldn't that mean that if I had 10 Parent Objects with 1 Child Object each, it would lead to 10 read's to the DB for the child objects, instead of somehow setting it up to have just 1 read to obtain all the child objects?
  5. For example, we have users of 3 types: internal users (employees of our company), clients, and contractors, and they are all in the same table, with a "type" field to differentiate them. We also have different domains for each: internal.domain.com, clients.domain.com, and contractors.domain.com. With each domain mapping to a user type. In order to log in to these portals, you need to have the correct user/pw obviously, and have the user type match the domain as well. Should these users be split from 1 table into 3? One solution that has been mentioned is that the types of users would be classified as "roles", and therefore I would have an ACL to check this role for access to the domain. Any thoughts or input would be greatly appreciated!
  6. Appreciate the input guys! My followup question is that if you know that you will need to load all child objects in a specific situation, is there a way to load them all at once, rather than have them automatically set to lazy load, and therefore instead of x amounts of queries to the db, it would just be 1 for this scenario?
  7. I am just starting out with Doctrine 2 and trying to test out a bidirectional One to Many relationship. In this case, I have a user, which can have many comments. I have checked the Doctrine 2 documentation and it seems that I am doing it right, but it takes a really looong time to execute my script (with just a few rows in each tables), and I'm hoping someone can help point me in the right direction. Here is the php: /** * @Entity * @Table(name="users") */ class User { /** * @Id @GeneratedValue * @Column(type="bigint") * @var integer */ private $id; /** * @Column(type="string", length="250") * @var string */ protected $name; /** * @OneToMany(targetEntity="Comment", mappedBy="user") */ private $comments; } /** * @Entity * @Table(name="comments") */ class Comment { /** * @Id @GeneratedValue * @Column(type="bigint") * @var integer */ private $id; /** * @Column(type="text") * @var string */ private $text; /** * @ManyToOne(targetEntity="User", inversedBy="comments") * @JoinColumn(name="user_id", "referencedColumnName="id") */ private $user; }
  8. Thx for your reply, Ignace. If there are also specific instances where you know you will need to load all of the child objects, should there be some sort of flag set indicating that all the child objects should be loaded? Or is this potential performance hit a cost of the lazy load pattern??
  9. I have an object called student which maps to a student table. There is also a courses table, and user_courses table to assign students to courses. This student object can have many course objects, and therefore, with my Students DataMapper it will retrieve student objects and any course objects for the courses that the student is enrolled in. This works fine for the cases where I need all of this information, but in the cases where I only need to display the student name and last name, the retrieval of course objects is unnecessary. My question is, how should I design my dataMappers to account for this? Should I have separate mappers for different levels of student objects, i.e. baseStudentObject with just the basic student info and then an extendedStudentObject which additionally includes the course objects? Or better to implement some sort of lazy loading solution? As always, all input is very much appreciated! Cheers.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.