Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a twitter example

  • Loading branch information...
commit 20b1da54f5c75a7e76e758689c727959318d8552 1 parent 70d98bf
Jonathan H. Wage authored April 05, 2010

Showing 1 changed file with 34 additions and 0 deletions. Show diff stats Hide diff stats

  1. 34  example/twitter.php
34  example/twitter.php
... ...
@@ -0,0 +1,34 @@
  1
+<?php
  2
+
  3
+use Doctrine\REST\Client\Client,
  4
+    Doctrine\REST\Client\Manager,
  5
+    Doctrine\REST\Client\Entity,
  6
+    Doctrine\REST\Client\EntityConfiguration;
  7
+
  8
+require '../../../../../lib/Doctrine/Common/ClassLoader.php';
  9
+
  10
+$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\REST', '../lib');
  11
+$classLoader->register();
  12
+
  13
+$client = new Client();
  14
+$manager = new Manager($client);
  15
+$manager->registerEntity('Status');
  16
+
  17
+Entity::setManager($manager);
  18
+
  19
+class Status extends Entity
  20
+{
  21
+    public static function configure(EntityConfiguration $entityConfiguration)
  22
+    {
  23
+        $entityConfiguration->setUrl('http://api.twitter.com/1');
  24
+        $entityConfiguration->setname('statuses');
  25
+        $entityConfiguration->setUsername('username');
  26
+        $entityConfiguration->setPassword('password');
  27
+    }
  28
+}
  29
+
  30
+//$status = Status::execute(Client::POST, 'update', array('status' => 'testing this out'));
  31
+
  32
+//$status = Status::find('show', '11660732536');
  33
+
  34
+//$status = Status::execute(Client::DELETE, 'destroy/11660732536');

0 notes on commit 20b1da5

Please sign in to comment.
Something went wrong with that request. Please try again.