comparison core/modules/aggregator/src/Entity/Feed.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
comparison
equal deleted inserted replaced
17:129ea1e6d783 18:af1871eacc83
1 <?php 1 <?php
2 2
3 namespace Drupal\aggregator\Entity; 3 namespace Drupal\aggregator\Entity;
4 4
5 use Drupal\aggregator\FeedStorageInterface;
5 use Drupal\Core\Entity\ContentEntityBase; 6 use Drupal\Core\Entity\ContentEntityBase;
6 use Drupal\Core\Entity\EntityTypeInterface; 7 use Drupal\Core\Entity\EntityTypeInterface;
7 use Drupal\Core\Field\BaseFieldDefinition; 8 use Drupal\Core\Field\BaseFieldDefinition;
8 use Drupal\Core\Entity\EntityStorageInterface; 9 use Drupal\Core\Entity\EntityStorageInterface;
9 use Drupal\aggregator\FeedInterface; 10 use Drupal\aggregator\FeedInterface;
168 ->setDisplayConfigurable('form', TRUE) 169 ->setDisplayConfigurable('form', TRUE)
169 ->addConstraint('FeedUrl'); 170 ->addConstraint('FeedUrl');
170 171
171 $intervals = [900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200]; 172 $intervals = [900, 1800, 3600, 7200, 10800, 21600, 32400, 43200, 64800, 86400, 172800, 259200, 604800, 1209600, 2419200];
172 $period = array_map([\Drupal::service('date.formatter'), 'formatInterval'], array_combine($intervals, $intervals)); 173 $period = array_map([\Drupal::service('date.formatter'), 'formatInterval'], array_combine($intervals, $intervals));
173 $period[AGGREGATOR_CLEAR_NEVER] = t('Never'); 174 $period[FeedStorageInterface::CLEAR_NEVER] = t('Never');
174 175
175 $fields['refresh'] = BaseFieldDefinition::create('list_integer') 176 $fields['refresh'] = BaseFieldDefinition::create('list_integer')
176 ->setLabel(t('Update interval')) 177 ->setLabel(t('Update interval'))
177 ->setDescription(t('The length of time between feed updates. Requires a correctly configured cron maintenance task.')) 178 ->setDescription(t('The length of time between feed updates. Requires a correctly configured cron maintenance task.'))
178 ->setDefaultValue(3600) 179 ->setDefaultValue(3600)
184 'weight' => -2, 185 'weight' => -2,
185 ]) 186 ])
186 ->setDisplayConfigurable('form', TRUE); 187 ->setDisplayConfigurable('form', TRUE);
187 188
188 $fields['checked'] = BaseFieldDefinition::create('timestamp') 189 $fields['checked'] = BaseFieldDefinition::create('timestamp')
189 ->setLabel(t('Checked')) 190 ->setLabel(t('Checked', [], ['context' => 'Examined']))
190 ->setDescription(t('Last time feed was checked for new items, as Unix timestamp.')) 191 ->setDescription(t('Last time feed was checked for new items, as Unix timestamp.'))
191 ->setDefaultValue(0) 192 ->setDefaultValue(0)
192 ->setDisplayOptions('view', [ 193 ->setDisplayOptions('view', [
193 'label' => 'inline', 194 'label' => 'inline',
194 'type' => 'timestamp_ago', 195 'type' => 'timestamp_ago',