PHPackages                             salebab/fdo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. salebab/fdo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

salebab/fdo
===========

FDO - Facebook Data Object

1117PHP

Since Nov 18Pushed 12y ago2 watchersCompare

[ Source](https://github.com/salebab/FDO)[ Packagist](https://packagist.org/packages/salebab/fdo)[ RSS](/packages/salebab-fdo/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

FDO - Facebook Data Object
==========================

[](#fdo---facebook-data-object)

The ***Facebook Data Object*** (FDO) is a simple interface for querying data from Facebook Graph API using **FQL (Facebook Query Language)**. It uses CURL for querying.

*FDO interface is very similar to PDO, since PDO has a very understandable methods and majority of PHP developers are very familiar with them.*Examples
-------------------------------------------------------------------------------------------------------------------------------------------------------

[](#fdo-interface-is-very-similar-to-pdo-since-pdo-has-a-very-understandable-methods-and-majority-of-php-developers-are-very-familiar-with-themexamples)

**Fetch a single user object**

```
use fdo\FDO;
$fdo = new FDO();

$fql = "SELECT uid, name, sex FROM user WHERE uid = :uid";
$stmt = $fdo->prepare($fql);
$stmt->bindValue(":uid", 4, FDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetch(FDO::FETCH_OBJ);
var_dump($result);
```

**Fetch single column, fetch collection**

```
use fdo\FDO;
$fdo = new FDO($access_token); // Provide an active access_token

// Count friends
$fql = "SELECT friend_count FROM user WHERE uid = me()";
echo "Count friends: ". $fdo->query($fql)->fetchColumn();

// List me and all of my friends
$fql = "SELECT uid, name FROM user WHERE uid = :me OR uid IN (SELECT uid2 FROM friend WHERE uid1 = :me) ORDER BY name";
$stmt = $fdo->prepare($fql);
$stmt->bindValue(":me", "me()", FDO::PARAM_FUNC);
$stmt->execute();
echo "Friends:". PHP_EOL;
echo str_pad("num", 4, " ", STR_PAD_LEFT) . " ". str_pad("uid", 22) . "name" . PHP_EOL;
$i = 0;
while($friend = $stmt->fetch(FDO::FETCH_OBJ)) {
    echo str_pad(++$i, 4, " ", STR_PAD_LEFT) . " " . str_pad($friend->uid, 22) . $friend->name . PHP_EOL;
}
```

**Important notice:** The library is still in a heavy development and some planed functionality is not implement yet. Please contribute if you think that the library is useful.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/246858?v=4)[Aleksandar Babic](/maintainers/salebab)[@salebab](https://github.com/salebab)

---

Top Contributors

[![salebab](https://avatars.githubusercontent.com/u/246858?v=4)](https://github.com/salebab "salebab (28 commits)")

### Embed Badge

![Health badge](/badges/salebab-fdo/health.svg)

```
[![Health](https://phpackages.com/badges/salebab-fdo/health.svg)](https://phpackages.com/packages/salebab-fdo)
```

###  Alternatives

[alt-design/alt-seo

Alt SEO addon, add SEO tags to your site

1230.7k](/packages/alt-design-alt-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
