Source of file TripAdvisorLocation.php
Size: 0,932 Bytes - Last Modified: 2021-12-23T10:02:03+00:00
/var/www/docs.ssmods.com/process/src/code/model/TripAdvisorLocation.php
123456789101112131415161718192021222324252627282930313233343536373839 | <?php /** * Created by PhpStorm. * User: Julian Scheuchenzuber <js@lvl51.de> * Date: 10.08.15 * Time: 21:44 */ class TripAdvisorLocation extends DataObject { private static $db = array( 'Name' => 'Varchar(255)', 'URL' => 'Varchar(255)', 'PriceLevel' => 'Varchar(5)', 'Rating' => 'Decimal(2,1)', 'RatingImageURL' => 'Varchar(255)', 'NumReviews' => 'Int' ); private static $has_many = array( 'Reviews' => 'TripAdvisorReview' ); /** * Returns in the currently synced profile record. * @return DataObject */ public static function current() { return TripAdvisorLocation::get()->first(); } /** * Ensures that there can only be one record at a time. * @param null $member * @return bool */ public function canCreate($member = null) { return !TripAdvisorLocation::get()->first(); } } |