PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Notes

Notes can be saved, retrieved, and deleted. They are uniquely identified by a numeric ID value.

Example 820. Working With Notes

<?php
$simpy 
= new Zend_Service_Simpy('yourusername''yourpassword');

/* Save a note */
$simpy->saveNote(
    
'Test Note'// Title
    
'test,note'// Tags
    
'This is a test note.' // Description
);

/* Overwrite an existing note */
$simpy->saveNote(
    
'Updated Test Note'// Title
    
'test,note,updated'// Tags
    
'This is an updated test note.'// Description
    
$note->getId() // Unique identifier
);

/* Search for the 10 most recently added notes */
$noteSet $simpy->getNotes(null10);

/* Display the notes */
foreach ($noteSet as $note) {
    echo 
'<p>';
    echo 
$note->getTitle();
    echo 
'<br />';
    echo 
$note->getDescription();
    echo 
'<br >';
    echo 
$note->getTags();
    echo 
'</p>';
}

/* Search for all notes with 'PHP' in the title */
$noteSet $simpy->getNotes('title:PHP');

/* Search for all notes with 'PHP' in the title and
without 'framework' in the description */
$noteSet $simpy->getNotes('+title:PHP -description:framework');

/* Delete a note */
$simpy->deleteNote($note->getId());

Zend Framework