summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuampy2013-06-04 18:53:28 (GMT)
committer Juampy2013-06-04 18:53:28 (GMT)
commit8ff7b7b2b99c270e467adb705fe788a08271ae9a (patch)
tree3bb42375ac766ba8f2899651a5c9cacac332e0c6
parent9956b39f67d0644a2c8ba0fe9b65ce2e8185cdf8 (diff)
Namespaced Entity class and changed EntityFieldQuery by Drupal::EntityQuery().
-rw-r--r--twitter.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/twitter.module b/twitter.module
index b4eae4d..bd5ba11 100644
--- a/twitter.module
+++ b/twitter.module
@@ -4,6 +4,8 @@
* Provides API integration with the Twitter microblogging service.
*/
+use Drupal\Core\Entity\Entity;
+
define ('TWITTER_HOST', 'http://twitter.com');
define ('TWITTER_API', 'https://api.twitter.com');
define ('TWITTER_SEARCH', 'http://search.twitter.com');
@@ -197,7 +199,7 @@ function twitter_cron() {
// Pull up a list of Twitter accounts that are flagged for updating,
// sorted by how long it's been since we last updated them. This ensures
// that the most out-of-date accounts get updated first.
- $query = new EntityFieldQuery();
+ $query = Drupal::EntityQuery('twitter_account');
$query->entityCondition('entity_type', 'twitter_account')
->propertyCondition('uid', 0, '<>')
->propertyCondition('import', 1)
@@ -350,7 +352,7 @@ function twitter_user_load($accounts) {
* array with Twitter accounts
*/
function twitter_twitter_accounts($account) {
- $query = new EntityFieldQuery();
+ $query = Drupal::EntityQuery('twitter_account');
$query->entityCondition('entity_type', 'twitter_account')
->propertyCondition('uid', $account->uid);
$result = $query->execute();