Questions tagged [relation]

A relation on sets S1, S2, ..., SN is any subset of S1 x S2 x ... x SN, where 'x' denotes the Cartesian product. In other words, a relation over N sets is any set of ordered N-tuples over the N sets.

A relation on sets S1, S2, ..., SN is any subset of S1 x S2 x ... x SN, where 'x' denotes the Cartesian product. In other words, a relation over N sets is any set of ordered N-tuples over the N sets.

1457 questions
-1
votes
1 answer

Laravel relation data with first() method

Vender hasMany Banquet Here is my query: $banquet = Vendor::with(['banquet' => function($query){ $query->where('active',1)->where('id' ,1)->first(); }])->findOrfail(1); but the relation part return an collection like get() method…
Fan
  • 1,124
  • 3
  • 17
  • 35
-1
votes
2 answers

How to tackle this Inverse Relation homework?

Here is my assignment: Write a function inverse(rel) that takes a relation rel and returns the inverse relation of the relation rel. The inverse relation InvsetR of the relation R is dened as InvsetR = {(x, y) ∈ S × S |(y, x) ∈ R)}.…
Margarita
  • 7
  • 2
-1
votes
1 answer

Laravel5.2 withCount not working

I tried to use withCount() method just like the documentation and always i get this error : Call to undefined method Illuminate\Database\Query\Builder::withCount() public function index($id) { $data = \App\Institute::find($id); if(!$data) …
Mahmoud Abd AL Kareem
  • 615
  • 2
  • 10
  • 23
-1
votes
2 answers

In Rails, how do I select only a single object type from a relation query?

How do I select a single entity from a relation? I’m using Rails 4.2.3. I have the below query, which joins on another table, but I only wish to delete one of the objects (the object of type “UserMyObjectTimeMatch”) … …
Dave
  • 15,639
  • 133
  • 442
  • 830
-1
votes
2 answers

Get the full name from relation in model

I have model Blog and i have relation there: public function getRelUser() { return $this->hasOne(UrUser::className(), ['Id' => 'Rel_User']); } An i want to use fullName in my index of blogView in gridView:
qwerty
  • 101
  • 1
  • 10
-1
votes
4 answers

rails has_one through relation does not exist

rails, postgres, devise. There is a side table base with Corporations, to her I was connected successfully. Objective: To create a model User, which will be tied to the corporation, to enable the Corporation to log in as the user. I decided to make…
Marsel.V
  • 1,015
  • 1
  • 12
  • 28
-1
votes
1 answer

Why my tableView is repeating the last object? PFQuery using pointer

I want to list all favorite ServiceProviders from the current user. Everything is working right except the table view: its duplicating the last object. There is a class Favorite: objectId, User (pointer to User), ServiceProvider (pointer to…
Leo Rochadel
  • 131
  • 5
-1
votes
1 answer

Parse Pointer or Array?

I have a user table and a location table. A user can visit many locations and locations can be visited by many users. I want to return results, ordered by distance, of the nearest locations that a user has not visited. So many problems arise here.…
RonnyKnoxville
  • 6,166
  • 10
  • 46
  • 75
-1
votes
1 answer

android many-to-many relations in Parse.com

I'm using parse.com to develop my app. I want to add tagging features for uploaded images. I know I have to use many to many relation, because (one tag) can have many images, and (one image) can have many tags. I read the documentation where they…
Ran
  • 145
  • 2
  • 11
-1
votes
1 answer

Yii - validate custom field

I use model which not contain attribute 'countries' because I'm saving it in relations-model via many-to-many relation. When I'm creating form in view I use multiple select for custom field 'countries'. How can I validate it from model on…
-1
votes
1 answer

Many to many relationship with Django, Python

Currently i work on an application to manage drivers for cars and events written in Django, Python. I have the two Models: class Vehicle(models.Model): name = models.CharField(max_length=100) max_capacity =…
fechnert
  • 1,215
  • 2
  • 12
  • 30
-1
votes
1 answer

Symfony2 Many to One relation

Hello Stackoverflow community, I have a question and hope you can help me. I'm new to Symfony2 and try to establish a Many to One relationship. But It doesn't work. At first my two mySQL tables: TABLE user CREATE TABLE IF NOT EXISTS `user` ( `id`…
Marcel
  • 1
-1
votes
1 answer

How change relation between parents and childs in elasticsearch

How change relation between parents and childs in elasticsearch? I could not find information about it. In this question i gave the example of a simple mapping. How i can change street of address? Thanks!
-1
votes
1 answer

Find a NOT-antisymmetric and NOT-transitive relation on the "Real Numbers"

I am searching for a relation on the real numbers. This relation should be NOT antisymmetric and NOT transitive. I found a relation, which is antisymmetric and transitive. ( <= relation) Which relation on the real numbers is NOT antisymmetric and…
basti12354
  • 2,490
  • 4
  • 24
  • 43
-1
votes
2 answers

How Mysql join query on three tables with multiple colums?

I have three tables like this: Table1 english | hindi -------------- shakti | शक्ति sharma | शर्मा Table2 eng| hin ------------------ Jai |जय Jo | जो **Table3* name | commo| price | ---------------------------------- shakti | jai |…
user3493831
  • 47
  • 1
  • 1
  • 8