|
| static | fromURL ($url) |
| |
| static | tableScheme ($db_table) |
| |
| static | expireTableScheme () |
| |
| static | find ($id) |
| |
| static | exists ($id) |
| |
| static | countBySql ($sql=1, $params=array()) |
| |
| static | create ($data) |
| |
| static | build ($data, $is_new=true) |
| |
| static | buildExisting ($data) |
| |
| static | import ($data) |
| |
| static | findBySQL ($sql, $params=array()) |
| |
| static | findByObject (SimpleORMap $object) |
| |
| static | findOneBySQL ($where, $params=array()) |
| |
| static | findThru ($foreign_key_value, $options) |
| |
| static | findEachBySQL ($callable, $sql, $params=array()) |
| |
| static | findMany ($pks=array(), $order='', $order_params=array()) |
| |
| static | findEachMany ($callable, $pks=array(), $order='', $order_params=array()) |
| |
| static | findAndMapBySQL ($callable, $where, $params=array()) |
| |
| static | findAndMapMany ($callable, $pks=array(), $order='', $order_params=array()) |
| |
| static | deleteBySQL ($where, $params=array()) |
| |
| static | toObject ($id_or_object) |
| |
| static | __callStatic ($name, $arguments) |
| |
◆ __construct()
| __construct |
( |
|
$id = null | ) |
|
Constructor of the object. Provides a fallback if a url is passed instead of the usually expected numeric id in order to not break backward compatibility. But this constructor will fail miserably if a url is passed that is not in the database. This was chosen by design to encourage the correct use of an id.
- Parameters
-
| mixed | $id | Numeric id, existing url or null |
Reimplemented from SimpleORMap.
◆ configure()
| static configure |
( |
|
$config = array() | ) |
|
|
staticprotected |
Configures this model.
- Parameters
-
| Array | $config | Configuration array |
Reimplemented from SimpleORMap.
◆ fetch()
Fetches information from the url by getting the contents of the webpage, parse the webpage and extract the information from the opengraph meta-tags. If the site doesn't have any opengraph-metatags it is in fact no opengraph node and thus no data will be stored in the database. Only $url['is_opengraph'] === '0' indicates that the site is no opengraph node at all.
- Todo:
- The combination of FileManager::fetchURLMetadata() and the following request leads to two requests for the open graph data. This should be fixed due to performance reasons.
◆ fromURL()
Create an instance of this model given url. Differs from findOneByURL insofar that it will return a new object with the given url set instead of null.
- Parameters
-
- Returns
- OpenGraphURL Either existing instance or a new instance for the given url
◆ getAudioFiles()
Returns an array with all audiofiles that are provided by the opengraph-node. Each array-entry is an array itself with the url as first parameter and the content-type (important for <audio> tags) as the second.
- Returns
- array(array($url, $content_type), ...)
◆ getMediaFiles()
Returns an array with all mediafiles that are provided by the opengraph-node. Each array-entry is an array itself with the url as first parameter and the content-type (important for <audio> or <video> tags) as the second.
- Parameters
-
| string | $type | "audio" or "video" |
- Returns
- array(array($url, $content_type), ...)
◆ getVideoFiles()
Returns an array with all videofiles that are provided by the opengraph-node. Each array-entry is an array itself with the url as first parameter and the content-type (important for <video> tags) as the second.
- Returns
- array(array($url, $content_type), ...)
◆ render()
Renders a small box with the information of the opengraph url. Used in blubber and in the forum.
- Returns
- string html output of the box.
◆ store()
Stores the object and fetches the opengraph information when either the object is new or outdated.
- Returns
- int Number of updated records
Reimplemented from SimpleORMap.
◆ EXPIRES_DURATION
| const EXPIRES_DURATION = 86400 |
The documentation for this class was generated from the following file: