Top "Relationship" questions

Questions in this tag typically involve the association that a set of data has with other set(s) of data.

How do I reload a relation collection in laravel?

In laravel, after using attach() or detach() to add or remove something from a relation, the collection has not changed. …

php collections laravel laravel-4 relationship
Laravel check if relation is empty

I have an object with some relationships and I need to check if these relations are empty or not, I'm …

laravel relationship
Doctrine 2 - Disallow null value on foreign keys of ManyToOne relationships

I have a ManyToOne relationship in one of my entities, like so: class License { // ... /** * Customer who owns the license * * @var \…

php doctrine-orm relationship many-to-one
Eloquent relations - attach (but don't save) to Has Many

I have the following relations set up: class Page { public function comments() { return $this->hasMany('Comment'); } } class Comment { public …

laravel laravel-4 eloquent relationship
Ruby on rails - Reference the same model twice?

Is it possible to set up a double relationship in activerecord models via the generate scaffold command? For example, if …

ruby-on-rails rails-activerecord relationship
Laravel Eloquent ORM replicate

I have a problem with replicating one of my models with all the relationships. The database structure is as follows: …

php laravel eloquent clone relationship
What's the difference in notation for total participation and recursive relation?

Does the double line in the following ER diagrams means total participation or recursive relation? Could anyone tell me the …

entity-relationship relationship
UML association vs. composition and detail level

Actually, make that a couple of amateur UML questions! When creating a UML diagram to model some domain concepts and …

uml relationship composition
Add record to a has_and_belongs_to_many relationship

I have two models, users and promotions. The idea is that a promotion can have many users, and a user …

ruby-on-rails has-and-belongs-to-many relationship
set null value in a foreign key column?

I have this table CREATE TABLE [dbo].[CityMaster]( [CityID] [int] NOT NULL, [City] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_…

sql-server foreign-keys relational-database constraints relationship