SlideShare a Scribd company logo
1 of 13
Options
Overview
Objective

Learn how to use the options for storing and retrieving
data.

Requirements

 ProdigyView with an installed and accessible
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/util/Options.php
What are options?
Options is a type of storage that stores information in the
database based upon one or more keys.

Options are great for when you want to store
miscellaneous data or data that might not fit into the
normal schema design.

Options are tightly integrated to ProdigyView and can be
assigned to a user, a specific content, or an application.
Adding An Option
Adding an option will create a unique option. Remember
to pass the value you want to store in the option in the
option_value.
Setting An Option
    Setting an option and adding an option are different
    commands. Adding an option will create a unique option.
    Setting an option will update or create a value in the
    database defined by specific parameters.




1. Parameters




                                            2. Value
      3. Set the option
Adding vs Setting Visual
    The visual below assumes that the parameters passed in each
    method are the same.

 Method Called                               Database

PVTools::addOption                       New Option

PVTools::addOption                       New Option
                                         New Option
PVTools::addOption
                                         Empty Slot
                                         Empty Slot



                                           Empty Slot
 PVTools::setOption
                                           Option Placed

 PVTools::setOption                        Empty Slot
                                           Empty Slot
 PVTools::setOption
                                           Empty Slot
Set Option to Update
    Using the setOption method, we can update an options
    current value if the other parameters passed are the same.
    Changing on of the parameters will create a new option.




Keep the
same
parameters
to update




                             Update option_value with new data
Iterate and Update
    If we used the addOption method, there might be instances
    where we have multiple options with the same parameters. We
    can retrieve those by iterating through the options. The
    getOptionList() follows the PV Standard Search Query
    arguments.
1. Get the option list of all the options currently stored




                                  2. Update the option by passing it back through
Updating the option
   Looking closer at the options retrieved from the database
   on the last slide, the list is an array of arrays. When
   updating an option, it is important to pass that array back
   with the changed values in the updateOption method.



1. Iterate
through the
array of
arrays




2. Set a new
value in the field
in the option

                          3. Update the option by passed it back through
Searching
One of the things we can do is specify the parameters to
search for. Using the syntax in a PV Standard Search
Query, we can narrow the options retrieved.


  Search only for the option with type as coffee
Deleting

The last step is deleting an option. In order to do so, you
must have the option_id and pass it to the method
deleteOption.




  Delete the option by it’s id
API Reference
For a better understanding of the tools and options, visit
the api by clicking on the link below.

PVTools




                 More Tutorials
For more tutorials, please visit:

http://www.prodigyview.com/tutorials


                       www.prodigyview.com

More Related Content

More from ProdigyView

More from ProdigyView (20)

Building An Application
Building An ApplicationBuilding An Application
Building An Application
 
Installing Applications
Installing ApplicationsInstalling Applications
Installing Applications
 
Video Content Management
Video Content ManagementVideo Content Management
Video Content Management
 
Audio Content Management
Audio Content ManagementAudio Content Management
Audio Content Management
 
File Content Management
File Content ManagementFile Content Management
File Content Management
 
Email Configuration
Email ConfigurationEmail Configuration
Email Configuration
 
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
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
UK Journal
 

Recently uploaded (20)

Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdfBreaking Down the Flutterwave Scandal What You Need to Know.pdf
Breaking Down the Flutterwave Scandal What You Need to Know.pdf
 

Options Database Storage PHP

  • 2. Overview Objective Learn how to use the options for storing and retrieving data. Requirements  ProdigyView with an installed and accessible 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/util/Options.php
  • 4. What are options? Options is a type of storage that stores information in the database based upon one or more keys. Options are great for when you want to store miscellaneous data or data that might not fit into the normal schema design. Options are tightly integrated to ProdigyView and can be assigned to a user, a specific content, or an application.
  • 5. Adding An Option Adding an option will create a unique option. Remember to pass the value you want to store in the option in the option_value.
  • 6. Setting An Option Setting an option and adding an option are different commands. Adding an option will create a unique option. Setting an option will update or create a value in the database defined by specific parameters. 1. Parameters 2. Value 3. Set the option
  • 7. Adding vs Setting Visual The visual below assumes that the parameters passed in each method are the same. Method Called Database PVTools::addOption New Option PVTools::addOption New Option New Option PVTools::addOption Empty Slot Empty Slot Empty Slot PVTools::setOption Option Placed PVTools::setOption Empty Slot Empty Slot PVTools::setOption Empty Slot
  • 8. Set Option to Update Using the setOption method, we can update an options current value if the other parameters passed are the same. Changing on of the parameters will create a new option. Keep the same parameters to update Update option_value with new data
  • 9. Iterate and Update If we used the addOption method, there might be instances where we have multiple options with the same parameters. We can retrieve those by iterating through the options. The getOptionList() follows the PV Standard Search Query arguments. 1. Get the option list of all the options currently stored 2. Update the option by passing it back through
  • 10. Updating the option Looking closer at the options retrieved from the database on the last slide, the list is an array of arrays. When updating an option, it is important to pass that array back with the changed values in the updateOption method. 1. Iterate through the array of arrays 2. Set a new value in the field in the option 3. Update the option by passed it back through
  • 11. Searching One of the things we can do is specify the parameters to search for. Using the syntax in a PV Standard Search Query, we can narrow the options retrieved. Search only for the option with type as coffee
  • 12. Deleting The last step is deleting an option. In order to do so, you must have the option_id and pass it to the method deleteOption. Delete the option by it’s id
  • 13. API Reference For a better understanding of the tools and options, visit the api by clicking on the link below. PVTools More Tutorials For more tutorials, please visit: http://www.prodigyview.com/tutorials www.prodigyview.com