An electromagnetic door lock is a type of lock, normally shut, which is only ope for as long as someone is pressing a switch to keep it open. If the door is then shut, it stays shut without further action. The diagram below shows such a lock from above.
When the guard presses the switch, a coil passes through the coil and attracts the iron bar, allowing the door to be open. Current only flows for as long as the switch is pressed. If the switch is released, current ceases and the irn is pulled to close the oor by the springs.