Skip to content

Commit

Permalink
Merge pull request #9 from ShootProof/create-event-event-date-support
Browse files Browse the repository at this point in the history
Added event_date support to Sp_Api::createEvent().
  • Loading branch information
bdeshong committed Mar 23, 2015
2 parents c1c27f6 + e7479a0 commit 0a5ee6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/Sp_Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ public function getEvents($brandId = null)
*
* @param string $eventName
* @param integer $brandId Brand ID to create event in; optional.
* @param string $eventDate Date of Event (aka "Shoot Date"); optional.
* @return array
*/
public function createEvent($eventName, $brandId = null)
public function createEvent($eventName, $brandId = null, $eventDate = null)
{
if (is_null($eventName) || $eventName == '') {
throw new Exception('The eventName is required to create a new event.');
Expand All @@ -120,6 +121,10 @@ public function createEvent($eventName, $brandId = null)
$params['brand_id'] = $brandId;
}

if (strlen($eventDate) > 0) {
$params['event_date'] = $eventDate;
}

return $this->_makeApiRequest($params);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Sp_Lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Sp_Lib
*
* @var string
*/
protected $_version = 'php-1.6.0';
protected $_version = 'php-1.6.1';

/**
* Wrapper method to make an api request
Expand Down

0 comments on commit 0a5ee6d

Please sign in to comment.