diff --git a/composer.json b/composer.json index 72c6840..96c3a5e 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "description": "Cycle ORM Schema Builder", "require": { "php": ">=7.2", - "cycle/orm": "^1.0", + "cycle/orm": "^1.4", "yiisoft/friendly-exception": "^1.0" }, "require-dev": { diff --git a/src/Generator/GenerateRelations.php b/src/Generator/GenerateRelations.php index 252578a..62f392f 100644 --- a/src/Generator/GenerateRelations.php +++ b/src/Generator/GenerateRelations.php @@ -42,6 +42,7 @@ final class GenerateRelations implements GeneratorInterface 'throughOuterKey' => Relation::THROUGH_OUTER_KEY, 'throughWhere' => Relation::THROUGH_WHERE, 'where' => Relation::WHERE, + 'orderBy' => Relation::ORDER_BY, 'fkCreate' => RelationSchema::FK_CREATE, 'fkAction' => RelationSchema::FK_ACTION, 'indexCreate' => RelationSchema::INDEX_CREATE, diff --git a/src/Relation/HasMany.php b/src/Relation/HasMany.php index a2f8863..deee7ac 100644 --- a/src/Relation/HasMany.php +++ b/src/Relation/HasMany.php @@ -41,6 +41,9 @@ final class HasMany extends RelationSchema implements InversableInterface // custom where condition Relation::WHERE => [], + // custom orderBy rules + Relation::ORDER_BY => [], + // link to parent entity primary key by default Relation::INNER_KEY => '{source:primaryKey}', diff --git a/src/Relation/ManyToMany.php b/src/Relation/ManyToMany.php index 9c80d8f..21e9e7f 100644 --- a/src/Relation/ManyToMany.php +++ b/src/Relation/ManyToMany.php @@ -41,6 +41,9 @@ final class ManyToMany extends RelationSchema implements InversableInterface // custom where condition Relation::WHERE => [], + // custom orderBy rules + Relation::ORDER_BY => [], + // inner key of parent record will be used to fill "THROUGH_INNER_KEY" in pivot table Relation::INNER_KEY => '{source:primaryKey}', diff --git a/tests/Schema/ColumnTest.php b/tests/Schema/ColumnTest.php index a2759fb..ddaf70f 100644 --- a/tests/Schema/ColumnTest.php +++ b/tests/Schema/ColumnTest.php @@ -12,6 +12,7 @@ namespace Cycle\Schema\Tests; use Cycle\Schema\Definition\Field; +use Cycle\Schema\Exception\ColumnException; use Cycle\Schema\Table\Column; use Spiral\Database\Schema\AbstractTable; @@ -32,15 +33,14 @@ public function testColumn(): void $this->assertFalse($column->isNullable()); } - /** - * @expectedException \Cycle\Schema\Exception\ColumnException - */ public function testInvalidDeclaration(): void { $field = new Field(); $field->setType('7'); $field->setColumn('name'); + $this->expectException(ColumnException::class); + Column::parse($field); } @@ -60,18 +60,16 @@ public function testColumnNullableStrict(): void $this->assertTrue($column->isNullable()); } - /** - * @expectedException \Cycle\Schema\Exception\ColumnException - */ public function testNoDefaultValue(): void { $field = new Field(); $field->setType('string'); $field->setColumn('name'); - $column = Column::parse($field); $this->assertFalse($column->hasDefault()); + $this->expectException(ColumnException::class); + $column->getDefault(); } diff --git a/tests/Schema/Driver/MySQL/GenerateRelationsTest.php b/tests/Schema/Driver/MySQL/GenerateRelationsTest.php new file mode 100644 index 0000000..1266ba1 --- /dev/null +++ b/tests/Schema/Driver/MySQL/GenerateRelationsTest.php @@ -0,0 +1,10 @@ +assertSame('value', $e->getFields()->get('id')->getOptions()->get('name')); } - /** - * @expectedException \Cycle\Schema\Exception\OptionException - */ public function testGetUndefinedOption(): void { $e = new Entity(); $e->setRole('role'); - $e->getFields()->set('id', new Field()); + $this->expectException(\Cycle\Schema\Exception\OptionException::class); + $e->getFields()->get('id')->getOptions()->get('name'); } @@ -72,54 +71,50 @@ public function testSetRelation(): void $this->assertTrue($e->getRelations()->has('test')); } - /** - * @expectedException \Cycle\Schema\Exception\RelationException - */ public function testGetUndefined(): void { $e = new Entity(); $e->setRole('role'); $this->assertSame('role', $e->getRole()); + $this->expectException(RelationException::class); + $e->getRelations()->get('test'); } - /** - * @expectedException \Cycle\Schema\Exception\RelationException - */ public function testSetRelationDouble(): void { $e = new Entity(); $e->setRole('role'); $this->assertSame('role', $e->getRole()); - $e->getRelations()->set('test', new Relation()); + + $this->expectException(RelationException::class); + $e->getRelations()->set('test', new Relation()); } - /** - * @expectedException \Cycle\Schema\Exception\RelationException - */ public function testRelationNoTarget(): void { $e = new Entity(); $e->setRole('role'); $this->assertSame('role', $e->getRole()); - $e->getRelations()->set('test', new Relation()); + + $this->expectException(RelationException::class); + $e->getRelations()->get('test')->getTarget(); } - /** - * @expectedException \Cycle\Schema\Exception\RelationException - */ public function testRelationNoType(): void { $e = new Entity(); $e->setRole('role'); $this->assertSame('role', $e->getRole()); - $e->getRelations()->set('test', new Relation()); + + $this->expectException(RelationException::class); + $e->getRelations()->get('test')->getType(); } diff --git a/tests/Schema/FieldsTest.php b/tests/Schema/FieldsTest.php index 7b6c3a4..4025a29 100644 --- a/tests/Schema/FieldsTest.php +++ b/tests/Schema/FieldsTest.php @@ -13,16 +13,17 @@ use Cycle\Schema\Definition\Field; use Cycle\Schema\Definition\Map\FieldMap; +use Cycle\Schema\Exception\FieldException; use PHPUnit\Framework\TestCase; class FieldsTest extends TestCase { - /** - * @expectedException \Cycle\Schema\Exception\FieldException - */ public function testNoField(): void { $m = new FieldMap(); + + $this->expectException(FieldException::class); + $m->get('id'); } @@ -38,36 +39,33 @@ public function testSetGet(): void $this->assertSame(['id' => $f], iterator_to_array($m->getIterator())); } - /** - * @expectedException \Cycle\Schema\Exception\FieldException - */ public function testSetTwice(): void { $m = new FieldMap(); - $m->set('id', $f = new Field()); + + $this->expectException(FieldException::class); + $m->set('id', $f = new Field()); } - /** - * @expectedException \Cycle\Schema\Exception\FieldException - */ public function testNoType(): void { $m = new FieldMap(); - $m->set('id', $f = new Field()); + + $this->expectException(FieldException::class); + $m->get('id')->getType(); } - /** - * @expectedException \Cycle\Schema\Exception\FieldException - */ public function testNoColumn(): void { $m = new FieldMap(); - $m->set('id', $f = new Field()); + + $this->expectException(FieldException::class); + $m->get('id')->getColumn(); } } diff --git a/tests/Schema/Generator/GenerateRelationsTest.php b/tests/Schema/Generator/GenerateRelationsTest.php new file mode 100644 index 0000000..dfb1f2f --- /dev/null +++ b/tests/Schema/Generator/GenerateRelationsTest.php @@ -0,0 +1,84 @@ + ['orderBy', [], Relation::ORDER_BY], + 'custom orderBy' => ['orderBy', ['id' => 'DESC'], Relation::ORDER_BY], + 'default where' => ['where', [], Relation::WHERE], + 'custom where' => ['where', ['id' => '1'], Relation::WHERE], + ]; + } + + /** + * @dataProvider relationOptionsDataProvider + */ + public function testHasManyToManyRelationOptions(string $optionKey, $optionValue, int $relationKey): void + { + $post = Post::define(); + $tag = Tag::define(); + $tagContext = TagContext::define(); + + $post->getRelations()->remove('author'); + + $post->getRelations()->set('tags', new RelationDefinition()); + $post->getRelations()->get('tags') + ->setType('manyToMany') + ->setTarget('tag') + ->getOptions() + ->set('though', 'tagContext') + ->set($optionKey, $optionValue); + + $r = new Registry($this->dbal); + $r->register($post)->linkTable($post, 'default', 'post'); + $r->register($tag)->linkTable($tag, 'default', 'tag'); + $r->register($tagContext)->linkTable($tagContext, 'default', 'tag_context'); + + $c = new Compiler(); + $schema = $c->compile($r, [new RenderTables(), new GenerateRelations()]); + + $this->assertSame($optionValue, $schema['post'][Schema::RELATIONS]['tags'][Relation::SCHEMA][$relationKey]); + } + + /** + * @dataProvider relationOptionsDataProvider + */ + public function testHasManyRelationOptions(string $optionKey, $optionValue, int $relationKey): void + { + $e = Plain::define(); + $u = User::define(); + + $relation = $u->getRelations()->get('plain'); + $relation->setType('hasMany'); + $relation->getOptions()->set($optionKey, $optionValue); + + $r = new Registry($this->dbal); + $r->register($e)->linkTable($e, 'default', 'plain'); + $r->register($u)->linkTable($u, 'default', 'user'); + + $c = new Compiler(); + $schema = $c->compile($r, [new RenderTables(), new GenerateRelations()]); + + $this->assertSame($optionValue, $schema['user'][Schema::RELATIONS]['plain'][Relation::SCHEMA][$relationKey]); + } +} diff --git a/tests/Schema/Generator/ResolveInterfacesTest.php b/tests/Schema/Generator/ResolveInterfacesTest.php index 148207f..f8db50e 100644 --- a/tests/Schema/Generator/ResolveInterfacesTest.php +++ b/tests/Schema/Generator/ResolveInterfacesTest.php @@ -13,6 +13,7 @@ use Cycle\ORM\Schema; use Cycle\Schema\Compiler; +use Cycle\Schema\Exception\RelationException; use Cycle\Schema\Generator\GenerateRelations; use Cycle\Schema\Generator\ResolveInterfaces; use Cycle\Schema\Registry; @@ -49,9 +50,6 @@ public function testResolveInterfaceDependency(): void $this->assertArrayHasKey('author_id', $schema['post'][Schema::COLUMNS]); } - /** - * @expectedException \Cycle\Schema\Exception\RelationException - */ public function testUnableResolveInterfaceDependency(): void { $e = Post::define(); @@ -63,15 +61,14 @@ public function testUnableResolveInterfaceDependency(): void $r = new Registry($this->dbal); $r->register($e)->linkTable($e, 'default', 'post'); - $schema = (new Compiler())->compile($r, [ + $this->expectException(RelationException::class); + + (new Compiler())->compile($r, [ new ResolveInterfaces(), new GenerateRelations(['belongsTo' => new BelongsTo()]) ]); } - /** - * @expectedException \Cycle\Schema\Exception\RelationException - */ public function testInvalidStaticLink(): void { $e = Post::define(); @@ -83,15 +80,14 @@ public function testInvalidStaticLink(): void $r = new Registry($this->dbal); $r->register($e)->linkTable($e, 'default', 'post'); - $schema = (new Compiler())->compile($r, [ + $this->expectException(RelationException::class); + + (new Compiler())->compile($r, [ new ResolveInterfaces(), new GenerateRelations(['belongsTo' => new BelongsTo()]) ]); } - /** - * @expectedException \Cycle\Schema\Exception\RelationException - */ public function testAmbiguousDependency(): void { $e = Post::define(); @@ -106,7 +102,9 @@ public function testAmbiguousDependency(): void $r->register($u)->linkTable($u, 'default', 'author'); $r->register($u1)->linkTable($u1, 'default', 'user'); - $schema = (new Compiler())->compile($r, [ + $this->expectException(RelationException::class); + + (new Compiler())->compile($r, [ new ResolveInterfaces(), new GenerateRelations(['belongsTo' => new BelongsTo()]) ]); diff --git a/tests/Schema/RegistryTest.php b/tests/Schema/RegistryTest.php index f412f4a..9ff4fc5 100644 --- a/tests/Schema/RegistryTest.php +++ b/tests/Schema/RegistryTest.php @@ -15,6 +15,7 @@ use Cycle\Schema\Compiler; use Cycle\Schema\Definition\Entity; use Cycle\Schema\Definition\Field; +use Cycle\Schema\Exception\RegistryException; use Cycle\Schema\Registry; use Cycle\Schema\Tests\Fixtures\Author; use Cycle\Schema\Tests\Fixtures\Post; @@ -48,69 +49,60 @@ public function testGetEntity(): void $this->assertSame($e, $r->getEntity('user')); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testGetEntityException(): void { $r = new Registry($this->dbal); + $this->expectException(RegistryException::class); + $r->getEntity('user'); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testLinkTableException(): void { $r = new Registry($this->dbal); + $this->expectException(RegistryException::class); + $r->linkTable(new Entity(), 'default', 'table'); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testHasTableException(): void { $r = new Registry($this->dbal); + $this->expectException(RegistryException::class); + $r->hasTable(new Entity()); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testGetTableException(): void { $r = new Registry($this->dbal); + $this->expectException(RegistryException::class); + $r->getTable(new Entity()); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testGetDatabaseException(): void { $r = new Registry($this->dbal); + $this->expectException(RegistryException::class); + $r->getDatabase(new Entity()); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testGetTableSchemaException(): void { $r = new Registry($this->dbal); + $this->expectException(RegistryException::class); + $r->getTableSchema(new Entity()); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testRegisterChildNoEntity(): void { $e = new Entity(); @@ -138,6 +130,8 @@ public function testRegisterChildNoEntity(): void (new Field())->setType('string')->setColumn('name') ); + $this->expectException(RegistryException::class); + $r->registerChild($e, $c); } diff --git a/tests/Schema/Relation/BelongsToRelationTest.php b/tests/Schema/Relation/BelongsToRelationTest.php index 6a1a22a..97ae615 100644 --- a/tests/Schema/Relation/BelongsToRelationTest.php +++ b/tests/Schema/Relation/BelongsToRelationTest.php @@ -14,6 +14,7 @@ use Cycle\ORM\Relation; use Cycle\ORM\Schema; use Cycle\Schema\Compiler; +use Cycle\Schema\Exception\RegistryException; use Cycle\Schema\Generator\GenerateRelations; use Cycle\Schema\Generator\RenderRelations; use Cycle\Schema\Generator\RenderTables; @@ -138,9 +139,6 @@ public function testRenderTableRedefined(): void $this->assertFalse($table->hasForeignKey(['parent_id'])); } - /** - * @expectedException \Cycle\Schema\Exception\RegistryException - */ public function testInverseUnknownType(): void { $e = Post::define(); @@ -152,14 +150,13 @@ public function testInverseUnknownType(): void $r->register($e)->linkTable($e, 'default', 'post'); $r->register($u)->linkTable($u, 'default', 'author'); + $this->expectException(RegistryException::class); + (new Compiler())->compile($r, [ new GenerateRelations(['belongsTo' => new BelongsTo()]) ]); } - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testInverseInvalidType(): void { $e = Post::define(); @@ -171,6 +168,8 @@ public function testInverseInvalidType(): void $r->register($e)->linkTable($e, 'default', 'post'); $r->register($u)->linkTable($u, 'default', 'author'); + $this->expectException(\Cycle\Schema\Exception\SchemaException::class); + (new Compiler())->compile($r, [ new GenerateRelations([ 'belongsTo' => new BelongsTo(), diff --git a/tests/Schema/Relation/HasManyRelationTest.php b/tests/Schema/Relation/HasManyRelationTest.php index 242b7d2..aa92242 100644 --- a/tests/Schema/Relation/HasManyRelationTest.php +++ b/tests/Schema/Relation/HasManyRelationTest.php @@ -14,6 +14,7 @@ use Cycle\ORM\Relation; use Cycle\ORM\Schema; use Cycle\Schema\Compiler; +use Cycle\Schema\Exception\SchemaException; use Cycle\Schema\Generator\GenerateRelations; use Cycle\Schema\Generator\RenderRelations; use Cycle\Schema\Generator\RenderTables; @@ -147,9 +148,6 @@ public function testRenderTableRedefined(): void $this->assertFalse($table->hasForeignKey(['parent_id'])); } - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testInverseInvalidType(): void { $c = new Compiler(); @@ -163,6 +161,8 @@ public function testInverseInvalidType(): void $r->register($e)->linkTable($e, 'default', 'plain'); $r->register($u)->linkTable($u, 'default', 'user'); + $this->expectException(SchemaException::class); + (new GenerateRelations([ 'hasMany' => new HasMany(), 'manyToMany' => new ManyToMany() diff --git a/tests/Schema/Relation/HasOneRelationTest.php b/tests/Schema/Relation/HasOneRelationTest.php index 4a50d3e..07e0a70 100644 --- a/tests/Schema/Relation/HasOneRelationTest.php +++ b/tests/Schema/Relation/HasOneRelationTest.php @@ -14,6 +14,7 @@ use Cycle\ORM\Relation; use Cycle\ORM\Schema; use Cycle\Schema\Compiler; +use Cycle\Schema\Exception\SchemaException; use Cycle\Schema\Generator\GenerateRelations; use Cycle\Schema\Generator\RenderRelations; use Cycle\Schema\Generator\RenderTables; @@ -218,9 +219,6 @@ public function testRenderTableRedefined(): void $this->assertFalse($table->hasForeignKey(['parent_id'])); } - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testInverseInvalidType(): void { $c = new Compiler(); @@ -234,6 +232,8 @@ public function testInverseInvalidType(): void $r->register($e)->linkTable($e, 'default', 'plain'); $r->register($u)->linkTable($u, 'default', 'user'); + $this->expectException(SchemaException::class); + (new GenerateRelations([ 'hasOne' => new HasOne(), 'manyToMany' => new ManyToMany() diff --git a/tests/Schema/Relation/ManyToManyRelationTest.php b/tests/Schema/Relation/ManyToManyRelationTest.php index 45e7303..5ba6f83 100644 --- a/tests/Schema/Relation/ManyToManyRelationTest.php +++ b/tests/Schema/Relation/ManyToManyRelationTest.php @@ -15,6 +15,7 @@ use Cycle\ORM\Schema; use Cycle\Schema\Compiler; use Cycle\Schema\Definition\Relation as RelationDefinition; +use Cycle\Schema\Exception\SchemaException; use Cycle\Schema\Generator\GenerateRelations; use Cycle\Schema\Generator\RenderRelations; use Cycle\Schema\Generator\RenderTables; @@ -52,9 +53,6 @@ public function testGenerate(): void $this->assertInstanceOf(ManyToMany::class, $r->getRelation($post, 'tags')); } - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testDifferentDatabases(): void { $post = Post::define(); @@ -74,13 +72,11 @@ public function testDifferentDatabases(): void $r->register($tag)->linkTable($tag, 'secondary', 'tag'); $r->register($tagContext)->linkTable($tagContext, 'default', 'tag_context'); + $this->expectException(SchemaException::class); + (new GenerateRelations(['manyToMany' => new ManyToMany()]))->run($r); } - - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testDifferentDatabases2(): void { $post = Post::define(); @@ -100,6 +96,8 @@ public function testDifferentDatabases2(): void $r->register($tag)->linkTable($tag, 'default', 'tag'); $r->register($tagContext)->linkTable($tagContext, 'secondary', 'tag_context'); + $this->expectException(SchemaException::class); + (new GenerateRelations(['manyToMany' => new ManyToMany()]))->run($r); } @@ -199,9 +197,6 @@ public function testRenderTables(): void $this->assertTrue($table->hasForeignKey(['tag_id'])); } - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testInverseInvalidType(): void { $post = Post::define(); @@ -222,6 +217,8 @@ public function testInverseInvalidType(): void $r->register($tag)->linkTable($tag, 'default', 'tag'); $r->register($tagContext)->linkTable($tagContext, 'default', 'tag_context'); + $this->expectException(SchemaException::class); + (new GenerateRelations([ 'manyToMany' => new ManyToMany(), 'belongsTo' => new BelongsTo() diff --git a/tests/Schema/Relation/Morphed/BelongsToMorphedRelationTest.php b/tests/Schema/Relation/Morphed/BelongsToMorphedRelationTest.php index cc512b4..babe206 100644 --- a/tests/Schema/Relation/Morphed/BelongsToMorphedRelationTest.php +++ b/tests/Schema/Relation/Morphed/BelongsToMorphedRelationTest.php @@ -14,6 +14,7 @@ use Cycle\ORM\Relation; use Cycle\ORM\Schema; use Cycle\Schema\Compiler; +use Cycle\Schema\Exception\SchemaException; use Cycle\Schema\Generator\GenerateRelations; use Cycle\Schema\Generator\RenderRelations; use Cycle\Schema\Generator\RenderTables; @@ -50,9 +51,6 @@ public function testGenerate(): void $this->assertInstanceOf(BelongsToMorphed::class, $r->getRelation($e, 'parent')); } - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testGenerateInconsistentName(): void { $e = MorphedTo::define(); @@ -65,9 +63,9 @@ public function testGenerateInconsistentName(): void $r->register($a)->linkTable($a, 'default', 'author'); $r->register($p)->linkTable($p, 'default', 'in2'); - (new GenerateRelations(['belongsToMorphed' => new BelongsToMorphed()]))->run($r); + $this->expectException(SchemaException::class); - $this->assertInstanceOf(BelongsToMorphed::class, $r->getRelation($e, 'parent')); + (new GenerateRelations(['belongsToMorphed' => new BelongsToMorphed()]))->run($r); } public function testPackSchema(): void @@ -134,9 +132,6 @@ public function testRenderTable(): void $this->assertTrue($table->hasIndex(['parent_id', 'parent_role'])); } - /** - * @expectedException \Cycle\Schema\Exception\SchemaException - */ public function testInverseToInvalidType(): void { $e = MorphedTo::define(); @@ -152,7 +147,9 @@ public function testInverseToInvalidType(): void $r->register($a)->linkTable($a, 'default', 'author'); $r->register($p)->linkTable($p, 'default', 'post'); - $schema = (new Compiler())->compile($r, [ + $this->expectException(SchemaException::class); + + (new Compiler())->compile($r, [ new GenerateRelations([ 'belongsToMorphed' => new BelongsToMorphed(), 'hasOne' => new HasOne() diff --git a/tests/Schema/Relation/OptionSchemaTest.php b/tests/Schema/Relation/OptionSchemaTest.php index 81348ed..7a47873 100644 --- a/tests/Schema/Relation/OptionSchemaTest.php +++ b/tests/Schema/Relation/OptionSchemaTest.php @@ -12,6 +12,7 @@ namespace Cycle\Schema\Tests\Relation; use Cycle\ORM\Relation; +use Cycle\Schema\Exception\OptionException; use Cycle\Schema\Relation\OptionSchema; use Cycle\Schema\Relation\RelationSchema; use PHPUnit\Framework\TestCase; @@ -37,9 +38,6 @@ public function testAliases(): void $this->assertSame(100, $options->get(Relation::TYPE)); } - /** - * @expectedException \Cycle\Schema\Exception\OptionException - */ public function testInvalidAlias(): void { $options = new OptionSchema([ @@ -50,14 +48,13 @@ public function testInvalidAlias(): void Relation::TYPE => 200 ]); + $this->expectException(OptionException::class); + $options->withOptions([ 'unknown' => 100 ]); } - /** - * @expectedException \Cycle\Schema\Exception\OptionException - */ public function testInvalidAlias2(): void { $options = new OptionSchema([ @@ -70,6 +67,8 @@ public function testInvalidAlias2(): void 'alias' => 100 ]); + $this->expectException(OptionException::class); + $options->get(RelationSchema::FK_ACTION); }