symfony - Doctrine2: Entity with many types of "Parent" Entity -


new doctrine/symfony. have db structure need looking recommendations structure. have think need single entity able "child"(manytoone/manytomany) of multiple types of entities.

first example have account has both "projects" , "employees". have "documents" linked either project or employee. single "document" linked multiple projects and/or employee. (manytomany)

second use in project log table. have log linked account,project, employee, or document. simple (log)manytoone(object). thinking maybe sti work here. how relationships? each "object" own field on log table (accountid, projectid, employeeid, etc)? thinking better of have 1 field on log called "parentid" new object based of "type" field. thoughts?

thanks in advance!


Comments

Popular posts from this blog

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -