connection = $connection; } /** * @inheritdoc */ public function getName() { return 'Remove invalid object properties'; } /** * @inheritdoc */ public function run(IOutput $output) { $query = $this->connection->getQueryBuilder(); $updated = $query->delete('properties') ->where($query->expr()->in('propertyname', $query->createNamedParameter([self::RESOURCE_TYPE_PROPERTY, self::ME_CARD_PROPERTY, self::CALENDAR_TRANSP_PROPERTY], IQueryBuilder::PARAM_STR_ARRAY))) ->andWhere($query->expr()->eq('propertyvalue', $query->createNamedParameter('Object'), IQueryBuilder::PARAM_STR)) ->executeStatement(); $output->info("$updated invalid object properties removed."); } }