freezing an entity

how can i freeze an entity using lua

[lua]local po = ent:GetPhysicsObject()
if po and po:IsValid() then
po:EnableMotion(false)
end
[/lua]

Alternatly
[lua]
ent:SetMoveType(MOVETYPE_NONE)
[/lua]

thank you very much! it works now.