Joomla contact category in database - joomla3.0

I see that in the Joomla table "#_contact_details" the Contact Category to which the user belongs is referenced in the table as "catid". Can anyone tell me in which table I can find these Contact categories (=catid)?
THANKS

no answers...?!
ok, found it myself and post the answer, in case someone else finds this useful later.
The "Contact Categories" are stored (together with the "Article categories" and other component categories) in the "_categories" table.

Related

can we show Account records on Contact?

On Account object we have a related list called contact.If we want to add contact we can use Contact related list. then contact related list will created. But on the contact i could n't find the Acccount name in Account related list on Contact. Both Accounts and contacts are m-m relationship
Your question is bit weird. And it's not really programming-related. If my answer doesn't help you - try asking again at https://salesforce.stackexchange.com/
The default setup in Salesforce is that Accounts and Contacts are in 1:n relation. So you have related list of 0,1 or more Contacts under Account. But when you're on Contact there's only 1 Account to choose from. And it's the "Account Name" field, a lookup (foreign key), not a related list with exactly 1 item on it.
You're 1 click away from viewing the Account. If that's not enough, if you really want to display Account data on Contact - there are options such as formula fields or adding "record detail" component to the page and making it use Account Name instead of this Contact. You can see it on the right side in my screenshot:
When you make new Contact you can select existing Account or click "New" in the lookup and create one on the fly. But relation is still 1:n, A contact will have 0 (possible but an edge case and generally bad idea) or 1 account.
Then there's a special table called AccountContactRelation. It's used to model "one guy working in multiple companies, for example being director in company XYZ small local branch and at the same time - head of accounting in company XYZ headquater". If you want that, a real m:n relation - you might have to enable few things in Setup and configure your Salesforce like this training course: https://trailhead.salesforce.com/en/content/learn/modules/admin_intro_accounts_contacts/admin_intro_accounts_contacts_relationships
But on the contact i could n't find the Acccount name in Account
related list
So... if you already have the "Contacts to Multiple Accounts" enabled and added to page layouts and stuff - then perhaps it's as simple as checking the Contact page layout and editing the related list to include Account Name. But I have a feeling you skipped few steps on the way.

How can I find title of movies that have had no ratings or comments using mongoDB

In this task, I have to get all the title which have had no ratings and comments. There are two tables one is "Movie" and "Ratings". In Movie table, there are several columns including the information about the movies and in Rating table there are ratings about movies and Movie_ID is the common column in these two tables.
I tried to get the work done:
db.movies.find({$or:[{"Comments":null},{"Rating":null}]}).pretty();
and this also
db.movies.find({[{$group:{_id:"$Movie_ID"}}]},{$or:[{"Comments":null},{"Rating":null}]}
But this is not working. Here is the excel sheet.
Please help if any one can help. Thankyou.

sonata admin one-to-many and many-to-one display list

I have a project about nurse and patients. Nurse goes around and visits patients. The problem that I'm facing is that the nurse wants to see a list of all the visits they did for a patient.
I do have two admin pages, one is the patients admin (allows to create/edit patients) and another one that allows to log visits. Within the visit you select the patient. From the patient list, how can I list all of the visits a nurse did for a patient? and further more, allow to click an add button to log a new visit.
I don't have code to show, but if any of you can point to some documentation, or sample code, will be much appreciated.
On the patient edit page you could do the following. Assuming your entity is called something like VisitLogs. You can add the following to configureFormFields
$formMapper->Add('VisitLogs', 'sonata_type_collection' ['type_options' => ['btn_add' => true]], ['inline' => 'table', 'edit' => 'inline']);
This should display a table with the Visitlogs based on the patients (if the ORM is correctly setup) and shows a add new button.
I hope this somewhat helps you a little bit further. More information.
Note This is for the one-to-many relation. I'm guessing for the many-to-one relation you should use sonata_type_model not sure about that though.

Simple Database Schema for a tech blog

I am building a simple tech blog and this is my database.
Because I don't really have a lot of experience I am looking to get some feedback if its an OK schema.
I will have 5 categories: Computer, mobile , laptop , tablet and General.
For users I will only have an admin to begin with and maybe I will add users later.
User will only be able to comment/share on the posts nothing more.
Only admins will be able to create posts etc.
Guests will only be able to browse the site and share posts.
I would like to add a feature to be able to count how many shares have been made for a specific post but later.
Also I might add sub categories to each category (for this I think that I need another table to track those).
Any help is appreciated, thanks in advance.
In my view, you should add a comments table; in your database a Post can have only one comment.
Comments should have this fields at minimum: id, body, post_id, user_id, because they belong to a Post and to a User.
In the posts table add fields: user_id and category_id because each post belongs to a User and to a Category; and remove the comment field because a post can have many comments.

cakePHP hasMany not joining the SQL query

I am unable to do a simple condition for my paginator. I have a Survey and Campaign models. Campaigns hasMany Surveys setup in the Campaign model.
I want to select a survey and the paginator should display the campaign is linked to, but I keep getting a Unknown column Survey.id - On inspection I see that Survey is not joined to the Campaign model, only in the WHERE clause. I also found out that hasMany does not join the tables to the query.
How else can I go about doing the above?
I could not find an answer to this. It appears that hasMany does not automatically get added to a query. I have had recommendations that using the containable feature in cake may help.

Resources