SlideShare une entreprise Scribd logo
1  sur  14
User Relationships




     www.prodigyview.com
Overview
Objective
Learn to create relationships between users, similar to
social networking sites.
Requirements
 Install version of ProdigyView with a database
  connection
 Understanding of how to create a user
Estimated Time
10 Minutes

                     www.prodigyview.com
Follow Along With Code
                 Example
1. Download a copy of the example code at
  www.prodigyview.com/source.
2. Install the system in an environment you feel comfortable testing in.
3. Proceed to examples/user/UsersRelationships.php
Having A Relationship
Having a relationship is nothing easy. It takes time,
commitment, lot of moneys and sometimes lots of
chocolate to feel loved if you are being neglected.
Thankfully in ProdigyView all you need to have is more
than one user and you can define a relationship between
them. We will be covering in tutorial:
 Creating a relationship
 Checking if a relationship exist
 Modifying a relationship
 Deleting a relationship(breaking up)
                      www.prodigyview.com
Add Some Users
Our example starts by first creating some users. If you are
following along in the code example, there are two more
users created besides the two below.
Creating A Relationship
  Now that we have our users present in the database, we
  can start creating relationships. It takes two to make this
  thing go right, so we at least require two users, a
  relationship type, and relationship status.

1. Add the first user          2. Add the second user




                                   4. Add the relationship status. Meaning of
3. Set the relationship type       numbers is set by you. Example '1 could be
                                   ‘accepted’ and 0 mean ‘pending’.
Database View
Your database should look something like after adding the
users.




                     www.prodigyview.com
Searching Relationships
Next we can search through our relationship using
getUserRelationshipList() method. The method uses PV
Standard Search arguments when querying for
matches.


1. Search for users based on the requesting users field




                    2. The ‘,’ symbolizes an OR used in SQL

3. Returns the relationships as an array of arrays
Compare Relationships
Since we are pulling out our users, lets do some comparisons
using the checkUserRelationship(). This method checks if
there is an relationship among users. Explanation on next
slide.




                       www.prodigyview.com
Comparison Explanation
  1. Iterate through the               2. Get the users information based on their
  relationships                        user_id in the relationship




3. Print out the found relationship type          4. Check is there is any
                                                  relationship based on the two
                                                  users ids

                            5. Results on next slide
The Comparison Results
If they are suppose be a family, something is definitely off.
Removing A Relationship
Obviously the relationships were not quite working out so
it’s time for everyone to go there separate ways. I guess
that means it’s time to delete some relationships.




       Delete the relationship by passing in the relationship id


                           www.prodigyview.com
Review
1. Add a relationship PVUsers::addUserRelationship()
2. Check if a relationship exist by using
   PVUsers::checkUserRelationship().

3. Search for user relationships with
   PVUsers::getUserRelationshipList()

4. Delete a user relationship with
   PVUsers::deleteUserRelationship()




                         www.prodigyview.com
API Reference
For a better understanding of the users, visit the api by
clicking on the link below.

PVUsers




                 More Tutorials
For more tutorials, please visit:

http://www.prodigyview.com/tutorials


                       www.prodigyview.com

Contenu connexe

Plus de ProdigyView

Plus de ProdigyView (20)

Building An Application
Building An ApplicationBuilding An Application
Building An Application
 
Installing Applications
Installing ApplicationsInstalling Applications
Installing Applications
 
HTML5 Tags and Elements Tutorial
HTML5 Tags and Elements TutorialHTML5 Tags and Elements Tutorial
HTML5 Tags and Elements Tutorial
 
HTML Forms Tutorial
HTML Forms TutorialHTML Forms Tutorial
HTML Forms Tutorial
 
Html Tags Tutorial
Html Tags TutorialHtml Tags Tutorial
Html Tags Tutorial
 
Video Conversion PHP
Video Conversion PHPVideo Conversion PHP
Video Conversion PHP
 
Sending Email Basics PHP
Sending Email Basics PHPSending Email Basics PHP
Sending Email Basics PHP
 
Tools ProdigyView
Tools ProdigyViewTools ProdigyView
Tools ProdigyView
 
Custom Validation PHP
Custom Validation PHPCustom Validation PHP
Custom Validation PHP
 
Basic File Cache Tutorial - PHP
Basic File Cache Tutorial - PHPBasic File Cache Tutorial - PHP
Basic File Cache Tutorial - PHP
 
Understanding Web Cache
Understanding Web CacheUnderstanding Web Cache
Understanding Web Cache
 
Javascript And CSS Libraries
Javascript And CSS LibrariesJavascript And CSS Libraries
Javascript And CSS Libraries
 
PHP Libraries
PHP LibrariesPHP Libraries
PHP Libraries
 
SQL Prepared Statements Tutorial
SQL Prepared Statements TutorialSQL Prepared Statements Tutorial
SQL Prepared Statements Tutorial
 
Database Basics
Database BasicsDatabase Basics
Database Basics
 
Implementing the Adapter Design Pattern
Implementing the Adapter Design PatternImplementing the Adapter Design Pattern
Implementing the Adapter Design Pattern
 
Intercepting Filters Design Pattern
Intercepting Filters Design PatternIntercepting Filters Design Pattern
Intercepting Filters Design Pattern
 
Creating Dynamic Objects PHP
Creating Dynamic Objects PHPCreating Dynamic Objects PHP
Creating Dynamic Objects PHP
 
PV Standard Search Query
PV Standard Search QueryPV Standard Search Query
PV Standard Search Query
 
Prodigyview XML COnfiguration File
Prodigyview XML COnfiguration FileProdigyview XML COnfiguration File
Prodigyview XML COnfiguration File
 

Dernier

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

User Relationships CMS PHP

  • 1. User Relationships www.prodigyview.com
  • 2. Overview Objective Learn to create relationships between users, similar to social networking sites. Requirements  Install version of ProdigyView with a database connection  Understanding of how to create a user Estimated Time 10 Minutes www.prodigyview.com
  • 3. Follow Along With Code Example 1. Download a copy of the example code at www.prodigyview.com/source. 2. Install the system in an environment you feel comfortable testing in. 3. Proceed to examples/user/UsersRelationships.php
  • 4. Having A Relationship Having a relationship is nothing easy. It takes time, commitment, lot of moneys and sometimes lots of chocolate to feel loved if you are being neglected. Thankfully in ProdigyView all you need to have is more than one user and you can define a relationship between them. We will be covering in tutorial:  Creating a relationship  Checking if a relationship exist  Modifying a relationship  Deleting a relationship(breaking up) www.prodigyview.com
  • 5. Add Some Users Our example starts by first creating some users. If you are following along in the code example, there are two more users created besides the two below.
  • 6. Creating A Relationship Now that we have our users present in the database, we can start creating relationships. It takes two to make this thing go right, so we at least require two users, a relationship type, and relationship status. 1. Add the first user 2. Add the second user 4. Add the relationship status. Meaning of 3. Set the relationship type numbers is set by you. Example '1 could be ‘accepted’ and 0 mean ‘pending’.
  • 7. Database View Your database should look something like after adding the users. www.prodigyview.com
  • 8. Searching Relationships Next we can search through our relationship using getUserRelationshipList() method. The method uses PV Standard Search arguments when querying for matches. 1. Search for users based on the requesting users field 2. The ‘,’ symbolizes an OR used in SQL 3. Returns the relationships as an array of arrays
  • 9. Compare Relationships Since we are pulling out our users, lets do some comparisons using the checkUserRelationship(). This method checks if there is an relationship among users. Explanation on next slide. www.prodigyview.com
  • 10. Comparison Explanation 1. Iterate through the 2. Get the users information based on their relationships user_id in the relationship 3. Print out the found relationship type 4. Check is there is any relationship based on the two users ids 5. Results on next slide
  • 11. The Comparison Results If they are suppose be a family, something is definitely off.
  • 12. Removing A Relationship Obviously the relationships were not quite working out so it’s time for everyone to go there separate ways. I guess that means it’s time to delete some relationships. Delete the relationship by passing in the relationship id www.prodigyview.com
  • 13. Review 1. Add a relationship PVUsers::addUserRelationship() 2. Check if a relationship exist by using PVUsers::checkUserRelationship(). 3. Search for user relationships with PVUsers::getUserRelationshipList() 4. Delete a user relationship with PVUsers::deleteUserRelationship() www.prodigyview.com
  • 14. API Reference For a better understanding of the users, visit the api by clicking on the link below. PVUsers More Tutorials For more tutorials, please visit: http://www.prodigyview.com/tutorials www.prodigyview.com